mirror of
https://github.com/correl/dotfiles.git
synced 2024-12-18 11:06:17 +00:00
[provisioning] Do not restart shell unless necessary or requested
This commit is contained in:
parent
087cd1ba7b
commit
a95309f8e3
2 changed files with 12 additions and 3 deletions
11
provision.sh
11
provision.sh
|
@ -24,6 +24,10 @@ while [[ $# -gt 0 ]]; do
|
||||||
INSTALL=($RECIPES)
|
INSTALL=($RECIPES)
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-r|--restart)
|
||||||
|
RESTART_SHELL=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
INSTALL+=("$1")
|
INSTALL+=("$1")
|
||||||
shift
|
shift
|
||||||
|
@ -68,5 +72,8 @@ for recipe in "${INSTALL[@]}"; do
|
||||||
_recipe $recipe
|
_recipe $recipe
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Finished, restarting shell."
|
echo "Finished"
|
||||||
exec $SHELL
|
if [ -n "$RESTART_SHELL" ]; then
|
||||||
|
echo "Restarting shell."
|
||||||
|
exec $SHELL
|
||||||
|
fi
|
||||||
|
|
|
@ -29,9 +29,11 @@ esac
|
||||||
if [ "$__shell" != "$__zsh_bin" ]; then
|
if [ "$__shell" != "$__zsh_bin" ]; then
|
||||||
echo "Install $__zsh_bin as default shell (currently $__shell)"
|
echo "Install $__zsh_bin as default shell (currently $__shell)"
|
||||||
sudo chsh -s $__zsh_bin ${USER}
|
sudo chsh -s $__zsh_bin ${USER}
|
||||||
|
export SHELL=$__zsh_bin
|
||||||
|
RESTART_SHELL=1
|
||||||
fi
|
fi
|
||||||
export SHELL=$__zsh_bin
|
|
||||||
|
|
||||||
if ! [ -f ${HOME}/.zshrc ]; then
|
if ! [ -f ${HOME}/.zshrc ]; then
|
||||||
_run "Install .zshrc" ln -s ${HOME}/dotfiles/.zshrc ${HOME}/.zshrc
|
_run "Install .zshrc" ln -s ${HOME}/dotfiles/.zshrc ${HOME}/.zshrc
|
||||||
|
RESTART_SHELL=1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue