Skip to content

Commit

Permalink
add: modify fish and zsh configuration as well (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
YYYasin19 authored Jun 14, 2023
1 parent ca5d60e commit 3e10b5a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,31 @@ fi
mkdir -p "$INSTALL_DIR"
tar -xzf "$TEMP_FILE" -C "$INSTALL_DIR"

# Make it executable and add it to the path.
# bash: add line to config such that pixi is in the path
LINE="export PATH=\$PATH:${INSTALL_DIR}"
if ! grep -Fxq "$LINE" ~/.bash_profile
then
echo "$LINE" >> ~/.bash_profile
fi

# fish: if config.fish exists, add pixi to the path
if [[ -f ~/.config/fish/config.fish ]]; then
LINE="fish_add_path ${INSTALL_DIR}"
if ! grep -Fxq "$LINE" ~/.config/fish/config.fishfi

This comment has been minimized.

Copy link
@jonashaag

jonashaag Jun 14, 2023

@YYYasin19 fishfi?

This comment has been minimized.

Copy link
@YYYasin19

YYYasin19 Jun 14, 2023

Author Contributor

oh damn, that's a typo.
Worst case it add's the line a second time because it doesn't exist in config.fishfi
fix is on it's way..

then
echo "$LINE" >> ~/.config/fish/config.fish
fi
fi

# zsh: if zshrc exists, add pixi to the path
if [[ -f ~/.zshrc ]]; then
LINE="export PATH=\$PATH:${INSTALL_DIR}"
if ! grep -Fxq "$LINE" ~/.zshrc
then
echo "$LINE" >> ~/.zshrc
fi
fi

chmod +x "$INSTALL_DIR/pixi"

echo "Please restart or source your shell."
Expand Down

0 comments on commit 3e10b5a

Please sign in to comment.