Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
  • Loading branch information
mrclary and ccordoba12 authored Jul 19, 2023
1 parent ba9fe93 commit 4e6804d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions installers-conda/resources/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ add_alias() {
}

# ----
if [[ "$all_user" = "true" ]]; then
shell_init_list=("/etc/zshrc")
[[ "$OSTYPE" = "darwin"* ]] && shell_init_list+=("/etc/bashrc") || shell_init_list+=("/etc/bash.bashrc")
if [[ "$all_user" = "true" && "$OSTYPE" = "darwin"* ]]; then
shell_init_list=("/etc/zshrc" "/etc/bashrc")
elif [[ "$all_user" = "true" ]]; then
shell_init_list=("/etc/zsh/zshrc" "/etc/bash.bashrc")
else
case $SHELL in
(*"zsh") shell_init_list=("$HOME/.zshrc") ;;
(*"bash") shell_init_list=("$HOME/.bashrc") ;;
esac
fi

for shell_init in ${shell_init_list[@]}; do
[[ -z "$shell_init" || -z "$alias_text" ]] && continue
[[ "$all_user" = "true" && ! -f "$shell_init" ]] && continue # Don't create non-existent global init file
Expand Down

0 comments on commit 4e6804d

Please sign in to comment.