summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gist8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/gist b/scripts/gist
index 5c62a18..20e8f06 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -97,8 +97,7 @@ _validate_config(){
97 echo 'Hi fellow! To access your gists, I need your Github username' 97 echo 'Hi fellow! To access your gists, I need your Github username'
98 echo "Also a personal token with scope which allows "gist"!'" 98 echo "Also a personal token with scope which allows "gist"!'"
99 echo 99 echo
100 _ask_username 100 _ask_username && _ask_token && init=true
101 _ask_token
102 elif [[ -z $token && $1 =~ ^(n|new|e|edit|D|delete)$ ]]; then 101 elif [[ -z $token && $1 =~ ^(n|new|e|edit|D|delete)$ ]]; then
103 if ! (_ask_token); then 102 if ! (_ask_token); then
104 echo 'To create/edit/delete a gist, a token is needed' 103 echo 'To create/edit/delete a gist, a token is needed'
@@ -180,10 +179,10 @@ _show_list() {
180 # if there is a commit not yet push, show red message "ahead" 179 # if there is a commit not yet push, show red message "ahead"
181 [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7 180 [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7
182 181
183 echo -e "$(printf "% 3s" $index) $link $name $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) )" 182 echo -e "$(printf "% 3s" $index)" $link $name $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) )
184 done < $INDEX \ 183 done < $INDEX \
185 | sed "$filter" 184 | sed "$filter"
186 echo -e '\nrun "gist help" for more details' > /dev/null 185 echo -e '\nrun "gist help" for more details' > /dev/tty
187} 186}
188 187
189# parse JSON from STDIN with string of commands 188# parse JSON from STDIN with string of commands
@@ -449,6 +448,7 @@ usage() {
449} 448}
450 449
451getConfiguredClient 450getConfiguredClient
451if [[ $init ]]; then _update; exit 0; fi
452case "$1" in 452case "$1" in
453 "") 453 "")
454 _show_list ;; 454 _show_list ;;