Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix install script for duplicate env variable #232

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,34 @@ execute() {
bash|sh)
export_command="export PATH=\"\$PATH:${BINDIR}\""
eval "$export_command"
echo "$export_command" >> "$HOME/.${current_shell}rc"
export PATH="$PATH:${BINDIR}"
if ! grep -q "export PATH=\"\$PATH:${BINDIR}\"" "$HOME/.${current_shell}rc"; then
echo "$export_command" >> "$HOME/.${current_shell}rc"
fi
echo "${YELLOW}To use the installed binaries, please restart the shell${RESET}"
;;
zsh)
export_command="export PATH=\"\$PATH:${BINDIR}\""
eval "$export_command"
echo "$export_command" >> "$HOME/.zshrc"
# Export PATH in the current shell
export PATH="$PATH:${BINDIR}"
if ! grep -q "export PATH=\"\$PATH:${BINDIR}\"" "$HOME/.zshrc"; then
echo "$export_command" >> "$HOME/.zshrc"
fi
echo "${YELLOW}To use the installed binaries, please restart the shell${RESET}"
;;
fish)
export_command="set -gx PATH \$PATH ${BINDIR}"
fish -c "$export_command"

echo "$export_command" >> "$HOME/.config/fish/config.fish"
# Export PATH in the current shell (for fish, this is already done by the fish -c command)

if ! grep -q "set -gx PATH \$PATH ${BINDIR}" "$HOME/.config/fish/config.fish" 2>/dev/null; then
echo "$export_command" >> "$HOME/.config/fish/config.fish"
fi
echo "${YELLOW}To use the installed binaries, please restart the shell${RESET}"
;;
*)
export_command="export PATH=\"\$PATH:${BINDIR}\""
eval "$export_command"
log_info "# Unable to automatically add to your shell's configuration file."
log_info "# Please manually add the appropriate line to your shell's configuration file to make it permanent."
# Export PATH in the current shell
export PATH="$PATH:${BINDIR}"
log_info "# Please manually add the following line to your shell's configuration file to make it permanent:"
log_info "# $export_command"
;;
esac

Expand Down