-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from hwixley/feature/wyx-git-support-for-gitla…
…b-bitbucket-azure [FEATURE]: git support for gitlab bitbucket azure
- Loading branch information
Showing
14 changed files
with
157 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# CLI CONSTS | ||
version="3.1.2" | ||
version="3.1.3" | ||
num_args=$# | ||
date=$(date) | ||
year="${date:24:29}" | ||
|
@@ -21,9 +21,27 @@ branch="" | |
if git rev-parse --git-dir > /dev/null 2>&1; then | ||
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | ||
fi | ||
remote=$(git config --get remote.origin.url | sed 's/.*\/\([^ ]*\/[^.]*\).*/\1/') | ||
repo_url=${remote#"[email protected]:"} | ||
remote=$(git config --get remote.origin.url) | ||
repo_url=$(echo "$remote" | sed 's/[^ \/]*\/\([^ ]*\/[^.]*\).*/\1/') | ||
repo_url=${repo_url%".git"} | ||
git_host="" | ||
if [[ $remote == *"github.com"* ]]; then | ||
git_host="github" | ||
repo_url=${repo_url#"[email protected]:"} | ||
elif [[ $remote == *"gitlab.com"* ]]; then | ||
git_host="gitlab" | ||
repo_url=${repo_url#"[email protected]:"} | ||
elif [[ $remote == *"bitbucket.org"* ]]; then | ||
git_host="bitbucket" | ||
repo_url=$(echo "$repo_url" | sed 's/\/[^ \/]*\/\([^ \/]*\/[^ \/]*\)/\1/') | ||
elif [[ $remote == *"azure.com"* ]]; then | ||
git_host="azure" | ||
org=$(echo "$repo_url" | sed 's/\([^ \/]*\).*/\1/') | ||
project=$(echo "$repo_url" | sed 's/[^ \/]*\/\([^ \/]*\).*/\1/') | ||
repo=$(echo "$repo_url" | sed 's/.*\/\([^ \/]*\)/\1/') | ||
repo_url="${org}/${project}/_git/${repo}" | ||
fi | ||
|
||
|
||
|
||
if [ $num_args -eq 0 ]; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sys.log.info "Redirecting to $branch on $repo_url..." | ||
wgit.giturl "https://github.com/$repo_url/tree/$branch" | ||
wgit.branch_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sys.log.info "Redirecting to Issues on $repo_url..." | ||
wgit.giturl "https://github.com/$repo_url/issues" | ||
wgit.issues_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sys.log.info "Redirecting to Action Workflows on $repo_url..." | ||
wgit.giturl "https://github.com/$repo_url/actions" | ||
wgit.pipelines_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sys.log.info "Creating PR for $branch in $repo_url..." | ||
wgit.giturl "https://github.com/$repo_url/pull/new/$branch" | ||
wgit.pr "$branch" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
sys.util.openurl "https://github.com/$(wyxd.user.username)" | ||
wgit.giturl "https://github.com/$(wyxd.user.username)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sys.log.info "Redirecting to Pull Requests on $repo_url..." | ||
wgit.giturl "https://github.com/$repo_url/pulls" | ||
wgit.prs_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sys.log.info "Redirecting to $repo_url..." | ||
wgit.giturl "https://github.com/$repo_url" | ||
wgit.repo_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters