diff options
author | typebrook <typebrook@gmail.com> | 2020-03-27 11:21:57 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-27 11:21:57 +0800 |
commit | 31a727b9a585cfd330966e0de79ac1e961ad88fb (patch) | |
tree | f0471d522622b51aba315816e9f94b022d52da8c | |
parent | 3a041ed5c2a25e59de65e1ec8da362308efc04cb (diff) |
Add default action 'into subshell'
-rwxr-xr-x | gist | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -473,12 +473,11 @@ _goto_gist() { | |||
473 | fi | 473 | fi |
474 | 474 | ||
475 | echo "$folder/$GIST_ID" | 475 | echo "$folder/$GIST_ID" |
476 | if [[ -z $action ]]; then | ||
477 | action='echo Inside subshell, press \<CTRL-D\> to exit; ${SHELL:-bash}' | ||
478 | fi | ||
476 | if [[ $2 == '--no-action' ]]; then | 479 | if [[ $2 == '--no-action' ]]; then |
477 | return 0 | 480 | return 0 |
478 | elif [[ -z $action ]]; then | ||
479 | echo > /dev/tty | ||
480 | echo 'hint: set action inside the repo, for example:' > /dev/tty | ||
481 | echo " gist config action 'ls' # list files of the given gist" > /dev/tty | ||
482 | else | 481 | else |
483 | cd "$folder/$GIST_ID" && eval "$action" | 482 | cd "$folder/$GIST_ID" && eval "$action" |
484 | fi | 483 | fi |