| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1504cd4 commit 75fe957
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,7 @@ | |||
| 1 | 1 | #!/bin/sh | |
| 2 | 2 | ||
| 3 | + PYGLAB_CONF=~/.python-gitlab.cfg | ||
| 4 | + | ||
| 3 | 5 | select_remote () { | |
| 4 | 6 | remotes=$(git remote) | |
| 5 | 7 | if [ $(echo $remotes | wc -w) -gt 1 ]; then | |
@@ -20,7 +22,7 @@ select_remote () { | |||
| 20 | 22 | ||
| 21 | 23 | instance_name() { | |
| 22 | 24 | host=$1 | |
| 23 | - grep -B 5 "^\s*url\s*=\s*http\(s\)*://$host" ~/.python-gitlab.cfg | grep "^\[" | tail -n 1 | sed -e 's#\[\(.\+\)\]#\1#' | ||
| 25 | + grep -B 5 "^\s*url\s*=\s*http\(s\)*://$host" $PYGLAB_CONF | grep "^\[" | tail -n 1 | sed -e 's#\[\(.\+\)\]#\1#' | ||
| 24 | 26 | } | |
| 25 | 27 | ||
| 26 | 28 | remote=$(git config gitlab.remote) | |
@@ -46,7 +48,7 @@ url=$(git remote get-url $remote) | |||
| 46 | 48 | host=$(echo $url | sed -e 's#^\(git\@\|[a-z]\+://\)\([^:/]\+\)[:/].*#\2#') | |
| 47 | 49 | instance=$(instance_name $host) | |
| 48 | 50 | if [ -z "$instance" ]; then | |
| 49 | - echo "No instance found for $host in ~/python-gitlab.cfg" | ||
| 51 | + echo "No instance found for $host in $PYGLAB_CONF" | ||
| 50 | 52 | exit 1 | |
| 51 | 53 | fi | |
| 52 | 54 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments