Fixed syntax error in update_path.sh
This commit is contained in:
parent
28491b7515
commit
61cd6685f4
1 changed files with 7 additions and 7 deletions
|
@ -1,19 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Get the current shell name
|
||||
current_shell="$(basename ${builtins.getEnv "SHELL"})"
|
||||
current_shell="$(basename "$SHELL")"
|
||||
|
||||
# Update the corresponding configuration file based on the current shell
|
||||
if [[ "$current_shell" == "bash" ]]; then
|
||||
cat >> "${builtins.getEnv "HOME"}/.bashrc" <<EOF
|
||||
export PATH="/Users/test/.cosmo/bin:\${builtins.getEnv "PATH"}"
|
||||
cat >> "${HOME}/.bashrc" <<EOF
|
||||
export PATH="/Users/test/.cosmo/bin:\${PATH}"
|
||||
EOF
|
||||
source "${builtins.getEnv "HOME"}/.bashrc"
|
||||
source "${HOME}/.bashrc"
|
||||
elif [[ "$current_shell" == "zsh" ]]; then
|
||||
cat >> "${builtins.getEnv "HOME"}/.zshrc" <<EOF
|
||||
export PATH="/Users/test/.cosmo/bin:\${builtins.getEnv "PATH"}"
|
||||
cat >> "${HOME}/.zshrc" <<EOF
|
||||
export PATH="/Users/test/.cosmo/bin:\${PATH}"
|
||||
EOF
|
||||
source "${builtins.getEnv "HOME"}/.zshrc"
|
||||
source "${HOME}/.zshrc"
|
||||
else
|
||||
echo "Unsupported shell: $current_shell"
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue