aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-12 23:56:05 +0800
committertypebrook <typebrook@gmail.com>2020-03-12 23:56:05 +0800
commit76e6d01dded802876e77faf80ec335f203be14bb (patch)
tree00ae352c4d1abec8f069d97a00fb4d2064e58c2d
parentf89c1996bdd800f80f05e817280c88e28b55381f (diff)
Replace default action with hint
-rwxr-xr-xgist9
1 files changed, 7 insertions, 2 deletions
diff --git a/gist b/gist
index b303612..361a8f3 100755
--- a/gist
+++ b/gist
@@ -45,7 +45,6 @@ configuredClient=""
45GITHUB_API=https://api.github.com 45GITHUB_API=https://api.github.com
46CONFIG=~/.config/gist.conf; mkdir -p ~/.config 46CONFIG=~/.config/gist.conf; mkdir -p ~/.config
47 47
48action="${EDITOR:-vi} ."
49[[ -z $hint ]] && hint=true # default to show hint with list of gist 48[[ -z $hint ]] && hint=true # default to show hint with list of gist
50[[ -z $confirm ]] && confirm=true # default to confirm when deleting gists 49[[ -z $confirm ]] && confirm=true # default to confirm when deleting gists
51auto_sync=true # automatically clone the gist repo 50auto_sync=true # automatically clone the gist repo
@@ -417,8 +416,14 @@ _goto_gist() {
417 fi 416 fi
418 fi 417 fi
419 418
420 [[ $2 != '--no-action' ]] && cd "$folder/$GIST_ID" && eval "$action"
421 echo "$folder/$GIST_ID" 419 echo "$folder/$GIST_ID"
420 if [[ -z $action ]]; then
421 echo > /dev/tty
422 echo 'hint: set action inside the repo, for example:' > /dev/tty
423 echo " gist config action 'ls' # ls files of the given gist" > /dev/tty
424 elif [[ $2 != '--no-action' ]]; then
425 cd "$folder/$GIST_ID" && eval "$action"
426 fi
422} 427}
423 428
424_delete_gist() { 429_delete_gist() {