From 31a727b9a585cfd330966e0de79ac1e961ad88fb Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 27 Mar 2020 11:21:57 +0800 Subject: Add default action 'into subshell' --- gist | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gist b/gist index 3a8de1b..6195cdd 100755 --- a/gist +++ b/gist @@ -473,12 +473,11 @@ _goto_gist() { fi echo "$folder/$GIST_ID" + if [[ -z $action ]]; then + action='echo Inside subshell, press \ to exit; ${SHELL:-bash}' + fi if [[ $2 == '--no-action' ]]; then return 0 - elif [[ -z $action ]]; then - echo > /dev/tty - echo 'hint: set action inside the repo, for example:' > /dev/tty - echo " gist config action 'ls' # list files of the given gist" > /dev/tty else cd "$folder/$GIST_ID" && eval "$action" fi -- cgit v1.2.3-70-g09d2