aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xgist7
1 files changed, 5 insertions, 2 deletions
diff --git a/gist b/gist
index 35427a8..c4788c0 100755
--- a/gist
+++ b/gist
@@ -74,7 +74,10 @@ fi
74 74
75# Default configuration 75# Default configuration
76python() { type python3 >&/dev/null && python3 "$@" || python "$@"; } 76python() { type python3 >&/dev/null && python3 "$@" || python "$@"; }
77[[ ! -t 1 && -z $hint ]] && hint=false 77if [[ ! -t 1 && -z $hint ]]; then
78 hint=false
79 PIPE_TO_SOMEWHERE=true
80fi
78init= 81init=
79 82
80# Shell configuration 83# Shell configuration
@@ -544,7 +547,7 @@ _goto_gist() {
544 echo "${folder}/${GIST_ID}" 547 echo "${folder}/${GIST_ID}"
545 touch "${folder}/${GIST_ID}" 548 touch "${folder}/${GIST_ID}"
546 549
547 if [[ $* =~ (-n|--no-action) ]]; then 550 if [[ $* =~ (-n|--no-action) || $PIPE_TO_SOMEWHERE == true ]]; then
548 return 0 551 return 0
549 elif [[ -z $action ]]; then 552 elif [[ -z $action ]]; then
550 action='echo You are in a subshell now, press \<CTRL-D\> to exit; echo; ls; ${SHELL:-bash}' 553 action='echo You are in a subshell now, press \<CTRL-D\> to exit; echo; ls; ${SHELL:-bash}'