File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 1616# ▜▛
1717# xero / syntax-samurai <http://git.io/gitio.sh>
1818
19- URLREGX=' (https?|http)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
20- GHURL=
21- VANITY=
22-
2319usage () {
2420 cat << EOF
2521
@@ -44,24 +40,24 @@ err() {
4440}
4541
4642optstest () {
47- FOUND =0
48- for var in " $@ "
43+ found =0
44+ for arg in " $@ "
4945 do
50- if [[ $var =~ $URLREGX ]]
46+ if echo $arg | awk -F/ ' {print $3} ' | grep -Eq " github.com "
5147 then
52- GHURL=$var
53- FOUND =1
54- elif [[ $var == " -h" ] ]
48+ GHURL=$arg
49+ found =1
50+ elif [ $arg = " -h" ]
5551 then
5652 usage
57- elif [[ $var == " -v" ] ]
53+ elif [ $arg = " -v" ]
5854 then
59- X=
55+ :
6056 else
61- VANITY=$var
57+ VANITY=$arg
6258 fi
6359 done
64- if (( FOUND == 0 ))
60+ if [ $found = 0 ]
6561 then
6662 err " must be a valid github.com url!"
6763 fi
You can’t perform that action at this time.
0 commit comments