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
|
#!/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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue