This adds support for the Fish shell to the -i shims.
A couple of notes:
I'm using the $SHELL environment variable to detect the shell so that we forward to the right activate script in the venv (Fish needs activate.fish). This isn't perfect, but it should generally be a reasonable way to detect the shell kind, especially for fish.
I switched from which slap to command -v slap in the USER_INIT_SCRIPT since I think we specifically want to check if the command exists. This breaks with bash/zsh, but felt more appropriate.
I'm using source over eval since that's really what we're doing. | psub is like Bash's <() so that we end up with a file path.
I think there's an argument for > ~/.config/fish/functions/slap.fish instead of >> ~/.config/fish/config.fish (it'll still be automatically picked up by Fish), but opted for consistency over idiom here.
This adds support for the Fish shell to the
-i
shims.A couple of notes:
$SHELL
environment variable to detect the shell so that we forward to the rightactivate
script in the venv (Fish needsactivate.fish
). This isn't perfect, but it should generally be a reasonable way to detect the shell kind, especially for fish.which slap
tocommand -v slap
in theUSER_INIT_SCRIPT
since I think we specifically want to check if the command exists. This breaks with bash/zsh, but felt more appropriate.source
overeval
since that's really what we're doing.| psub
is like Bash's<()
so that we end up with a file path.string match
are here if you're curious: https://fishshell.com/docs/current/cmds/string-match.html. It's just regex.I think there's an argument for
> ~/.config/fish/functions/slap.fish
instead of>> ~/.config/fish/config.fish
(it'll still be automatically picked up by Fish), but opted for consistency over idiom here.I followed https://github.com/NiklasRosenstein/slap/pull/74 as a guide, so I may have missed something else that needs to be changed if the code has evolved since then.