Skip to content

Commit

Permalink
k8s-lbry: Add warning in setup-alias if the user is not running bash.
Browse files Browse the repository at this point in the history
  • Loading branch information
EnigmaCurry authored and Leopere committed Jun 15, 2019
1 parent 45a5049 commit 8b8e97b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion contrib/k8s-lbry/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b8e97b

Please sign in to comment.