Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put leading new lines in shellrc additions #13

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -157,7 +157,7 @@ main() {
install_nix
install_devbox
install_direnv
direnv_shell_integration
shell_integrations
install_nix_direnv
print_further_steps
}
Expand Down