aquaproj / aquaproj.github.io

Website of aqua
https://aquaproj.github.io/
MIT License
5 stars 14 forks source link

add scripts for fish shell #1100

Open reyalka opened 2 months ago

reyalka commented 2 months ago

Scripts for fish are required in the following document

following code is written in that document:

export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"

However, it is only for bash or zsh. The script for fish user is required like this:

fish_add_path (set -q AQUA_ROOT_DIR; and echo $AQUA_ROOT_DIR; or set -q XDG_DATA_HOME; and echo $XDG_DATA_HOME; or echo $HOME/.local/share)/aquaproj-aqua/bin

(It is longer than sh script because fish shell doesn't have an operator :-)

reyalka commented 2 months ago

or you can implement like below:

if set -q AQUA_ROOT_DIR
    set -l aqua_path $AQUA_ROOT_DIR
else if set -q XDG_DATA_HOME
    set -l aqua_path $XDG_DATA_HOME
else
    set -l aqua_path $HOME/.local/share
end
fish_add_path $aqua_path/aquaproj-aqua/bin