tamerhayek / .dotfiles

Config Dotfiles & setup machines
0 stars 0 forks source link

Source ~/.zshrc after script #3

Closed tamerhayek closed 5 months ago

tamerhayek commented 5 months ago

Find a way to run source ~/.zshrc after running every script without errors

tamerhayek commented 5 months ago

source ~/.zshrc cannot be used in .sh files because relies on zsh profile.

So instead use exec /bin/zsh to source zsh.

In dotfiles.sh we check if $1 parameter is set and if not we source zsh.

if [ -z "$1" ];
  then
    exec /bin/zsh
fi

In setup.sh we can pass a random parameter to the script, so we can skip sourcing zsh and do it later after configuring everything else.

~/.dotfiles/scripts/dotfiles.sh source