| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5526479 commit 91c75bf
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,19 @@ select_remote () { | |||
| 23 | 23 | instance_name() { | |
| 24 | 24 | host=$1 | |
| 25 | 25 | pyglab_conf=$2 | |
| 26 | - grep -B 5 "^\s*url\s*=\s*http\(s\)*://$host" $pyglab_conf | grep "^\[" | tail -n 1 | sed -e 's#\[\(.\+\)\]#\1#' | ||
| 26 | + python3 -c "import re | ||
| 27 | + import sys | ||
| 28 | + from configparser import ConfigParser | ||
| 29 | + | ||
| 30 | + confparser = ConfigParser(allow_no_value=True) | ||
| 31 | + confparser.read(sys.argv[1]) | ||
| 32 | + proto=re.compile(r'http(s)*://') | ||
| 33 | + for section in confparser.sections(): | ||
| 34 | + url=confparser.get(section,'url',fallback=None) | ||
| 35 | + if url: url=proto.sub('',url) | ||
| 36 | + if url==sys.argv[2]: | ||
| 37 | + print(section) | ||
| 38 | + break" $pyglab_conf $host | ||
| 27 | 39 | } | |
| 28 | 40 | ||
| 29 | 41 | remote=$(git config gitlab.remote) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments