Skip to content

Commit

Permalink
Refactor install.sh script to support specifying the shell
Browse files Browse the repository at this point in the history
  • Loading branch information
connesy committed Mar 6, 2024
1 parent a420ce4 commit 9443f91
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,25 @@ install_zsh() {
}

main() {
if [ -n "${ZSH_VERSION}" ]; then
install_zsh
elif [ "${SHELL}" = "/bin/bash" ]; then
install_bash
else
echo "Current shell is not supported, aborting..."
return 1
fi
local shell="$1"

case "${shell}" in
"" | "bash")
install_bash
;;

"zsh")
install_zsh
;;

*)
echo "No install script available for '${shell}'."
echo "Use a different shell or install manually by adding 'source venv-cli/src/venv-cli/venv-cli.sh' to your shell's RC-file"
return 1
;;
esac

echo "venv installed"
}

main
main "$@"

0 comments on commit 9443f91

Please sign in to comment.