aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2023-08-16 09:15:35 +0100
committerGitHub <noreply@github.com>2023-08-16 09:15:35 +0100
commit72c6b17ac7ed0916df81eddae6aecfe97e4f0917 (patch)
treede2ac1e0b1d2ee6eac1cffe72f95f22c98e893ca
parentRemove terminal mode switching (#1170) (diff)
downloadatuin-72c6b17ac7ed0916df81eddae6aecfe97e4f0917.zip
Only setup shell plugin if it's not already there (#1178)
-rwxr-xr-xinstall.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/install.sh b/install.sh
index 2f854061..f80abbea 100755
--- a/install.sh
+++ b/install.sh
@@ -176,13 +176,18 @@ esac
# TODO: Check which shell is in use
# Use of single quotes around $() is intentional here
# shellcheck disable=SC2016
-printf '\neval "$(atuin init zsh)"\n' >> ~/.zshrc
+if ! grep -q "atuin init zsh" ~/.zshrc; then
+ printf '\neval "$(atuin init zsh)"\n' >> ~/.zshrc
+fi
-curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
-printf '\n[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh\n' >> ~/.bashrc
# Use of single quotes around $() is intentional here
# shellcheck disable=SC2016
-echo 'eval "$(atuin init bash)"' >> ~/.bashrc
+
+if ! grep -q "atuin init bash" ~/.bashrc; then
+ curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
+ printf '\n[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh\n' >> ~/.bashrc
+ echo 'eval "$(atuin init bash)"' >> ~/.bashrc
+fi
cat << EOF