diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index ebf1ec0..b3be13c 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -74,14 +74,14 @@ install_direnv() { fi } -direnv_shell_integration() { +shell_integrations() { DIRENV_BIN="$(command -v direnv)" DIRENV_BIN="${DIRENV_BIN:-$HOME/.nix-profile/bin/direnv}" shell=$(basename "$SHELL") case "$shell" in *bash*) rcfile="$HOME/.bashrc" - touch "$rcfile" + printf "\n" >>"$rcfile" cat <<-EOF >>"$rcfile" ### Do not edit. This was autogenerated by 'bootstrap.sh' ### export DIRENV_BIN="$DIRENV_BIN" @@ -91,7 +91,7 @@ direnv_shell_integration() { ;; *zsh*) rcfile="${ZDOTDIR:-$HOME}/.zshrc" - touch "$rcfile" + printf "\n" >>"$rcfile" cat <<-EOF >>"$rcfile" ### Do not edit. This was autogenerated by 'bootstrap.sh' ### export DIRENV_BIN="$DIRENV_BIN" @@ -102,7 +102,7 @@ direnv_shell_integration() { *fish*) rcfile="${XDG_DATA_HOME:-$HOME/.local/share}/fish/vendor_conf.d/direnv.fish" mkdir -p "$(dirname "$rcfile")" - touch "$rcfile" + printf "\n" >>"$rcfile" cat <<-EOF >>"$rcfile" ### Do not edit. This was autogenerated by 'bootstrap.sh' ### set -gx DIRENV_BIN "$DIRENV_BIN" @@ -157,7 +157,7 @@ main() { install_nix install_devbox install_direnv - direnv_shell_integration + shell_integrations install_nix_direnv print_further_steps }