aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Berryman <matthew@acrossthecloud.net>2025-03-10 09:06:44 +1030
committerGitHub <noreply@github.com>2025-03-09 22:36:44 +0000
commit81123b377f7d4fb187f1e374f1abf153a9e0ac58 (patch)
treef01ae58b2d3a71051cf246dbac772be3379c84f9
parentchore(deps): bump lukemathwalker/cargo-chef (#2595) (diff)
downloadatuin-81123b377f7d4fb187f1e374f1abf153a9e0ac58.zip
fixes #2603: support fish plugin in install script (#2604)
* fix: support fish plugin in install script * fix sed command on Linux for fish plugin install * light touch refactor for consistent and clearer cross-platform support * start the final end at the beginning of the line * ignore leading whitespace in fish config
-rwxr-xr-xinstall.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index a9babac1..35032fd3 100755
--- a/install.sh
+++ b/install.sh
@@ -53,6 +53,22 @@ if ! grep -q "atuin init bash" ~/.bashrc; then
echo 'eval "$(atuin init bash)"' >> ~/.bashrc
fi
+if [ -f "$HOME/.config/fish/config.fish" ]; then
+ # Check if the line already exists to prevent duplicates
+ if ! grep -q "atuin init fish" "$HOME/.config/fish/config.fish"; then
+ # Detect BSD or GNU sed
+ if sed --version >/dev/null 2>&1; then
+ # GNU
+ sed -i '/if status is-interactive/,/end/ s/end$/ atuin init fish | source\
+end/' "$HOME/.config/fish/config.fish"
+ else
+ # BSD (macOS)
+ sed -i '' '/if status is-interactive/,/end/ s/end$/ atuin init fish | source\
+end/' "$HOME/.config/fish/config.fish"
+ fi
+ fi
+fi
+
cat << EOF