Skip to content

Commit

Permalink
shell/fish: simplify setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
joshi4 committed Sep 17, 2024
1 parent 0acec24 commit 91c712e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions shell/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ type fish struct {
}

const fishBaseScript = `
set RED (tput setaf 1)
set RESET (tput sgr0)
switch "$OSTYPE"
case 'solaris*'
case 'darwin*'
Expand All @@ -38,7 +35,7 @@ switch "$OSTYPE"
echo "unknown: $OSTYPE"
end
set SAVVY_INPUT_FILE {{.SocketPath}}
set -g SAVVY_INPUT_FILE {{.SocketPath}}
# Fish doesn't use the same startup files as Bash, but we can approximate the behavior
if status is-login
Expand All @@ -57,11 +54,11 @@ else
end
end
if not functions -q savvy_cmd_pre_exec
echo "$RED Your shell is not configured to use Savvy. Please run the following commands: $RESET"
if not functions -q __savvy_record_pre_exec__
echo (set_color red) "Your shell is not configured to use Savvy. Please run the following commands: " (set_color normal)
echo
echo "$RED> echo 'eval (savvy init fish)' >> ~/.config/fish/config.fish$RESET"
echo "$RED> source ~/.config/fish/config.fish$RESET"
echo (set_color red)"> echo 'savvy init fish | source' >> ~/.config/fish/config.fish"(set_color normal)
echo (set_color red)"> source ~/.config/fish/config.fish"(set_color normal)
exit 1
end
`
Expand Down

0 comments on commit 91c712e

Please sign in to comment.