diff --git a/install.sh b/install.sh index ce88d09..3edf1b6 100755 --- a/install.sh +++ b/install.sh @@ -4,6 +4,7 @@ BASEDIR=$(dirname "$0") DEBIAN_PACKAGES="curl git build-essential libssl-dev libreadline-dev zlib1g-dev" +BASH_RELOAD=false # FUNCTIONS @@ -43,8 +44,12 @@ function install_mise { if [[ ! -f $HOME/.bashrc ]] || ! grep -q '.local/bin/mise activate bash' $HOME/.bashrc; then echo "eval \"\$($HOME/.local/bin/mise activate bash)\"" >>$HOME/.bashrc + fi + + if ! command -v mise >/dev/null; then source $HOME/.bashrc mise version + BASH_RELOAD=true fi if [[ ! -f $HOME/.config/mise/config.toml ]]; then @@ -78,6 +83,13 @@ function install_requirements { fi } +function optional_bash_reload { + if $BASH_RELOAD; then + echo 'reloading bash for mise' + exec bash + fi +} + # MAIN set -Eue @@ -86,3 +98,5 @@ install_miaou_bash install_mise install_ruby install_rails_templating + +optional_bash_reload