From 8b8e97b085370be039e3c4a8a6501ea968dfd47b Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Fri, 14 Jun 2019 16:46:56 -0400 Subject: [PATCH] k8s-lbry: Add warning in setup-alias if the user is not running bash. --- contrib/k8s-lbry/run.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/contrib/k8s-lbry/run.sh b/contrib/k8s-lbry/run.sh index e4fd0e6..f7bea0c 100755 --- a/contrib/k8s-lbry/run.sh +++ b/contrib/k8s-lbry/run.sh @@ -539,10 +539,25 @@ EOF echo "## I only know how to do completion for the bash shell." echo "## Try '$0 completion bash' instead." fi - } setup-alias() { + if [[ $SHELL != */bash ]]; then + echo "It looks like you are currently running $SHELL"; + echo "This tool only supports bash." + echo "" + echo "You will need to setup an alias in your own shell called \"$RUN_ALIAS\" for $BASEDIR/run.sh" + echo "" + read -p "Would you like to setup the alias for bash anyway? (Y/n)" choice + case "$choice" in + y|Y ) + echo "Note: You will need to run bash as a subshell before running $RUN_ALIAS" + ;; + * ) echo "Aborting" && exit 1 + ;; + esac + echo "" + fi $(which kubectl) completion bash > "$BASEDIR"/completion.bash.inc $(which helm) completion bash >> "$BASEDIR"/completion.bash.inc completion bash >> "$BASEDIR"/completion.bash.inc