Fixed syntax error in update_path.sh

This commit is contained in:
ajasibley 2023-05-25 02:13:01 -07:00
parent 28491b7515
commit 61cd6685f4

View file

@ -1,19 +1,19 @@
#!/bin/bash #!/bin/bash
# Get the current shell name # 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 # Update the corresponding configuration file based on the current shell
if [[ "$current_shell" == "bash" ]]; then if [[ "$current_shell" == "bash" ]]; then
cat >> "${builtins.getEnv "HOME"}/.bashrc" <<EOF cat >> "${HOME}/.bashrc" <<EOF
export PATH="/Users/test/.cosmo/bin:\${builtins.getEnv "PATH"}" export PATH="/Users/test/.cosmo/bin:\${PATH}"
EOF EOF
source "${builtins.getEnv "HOME"}/.bashrc" source "${HOME}/.bashrc"
elif [[ "$current_shell" == "zsh" ]]; then elif [[ "$current_shell" == "zsh" ]]; then
cat >> "${builtins.getEnv "HOME"}/.zshrc" <<EOF cat >> "${HOME}/.zshrc" <<EOF
export PATH="/Users/test/.cosmo/bin:\${builtins.getEnv "PATH"}" export PATH="/Users/test/.cosmo/bin:\${PATH}"
EOF EOF
source "${builtins.getEnv "HOME"}/.zshrc" source "${HOME}/.zshrc"
else else
echo "Unsupported shell: $current_shell" echo "Unsupported shell: $current_shell"
exit 1 exit 1