By default there are no ~/.bash_aliases or ~/.bash_functions files in user home directories. Using the [[ -f ~/.bash_aliases ]] && . ~/.bash_aliases shorthand causes the exit code 1 to persist after the line is run when no .bash_aliases file exists.
This causes any scripts that call ~/.bashrc (to set up a conda environment for example) to fail if they are trapping non-zero exit codes (or using set -e). This is the case in the IMI, and it can be a very confusing error for new group members getting set up for the first time.
I propose one of the following:
Creating blank .bash_aliases and .bash_functions files that are copied into user run directories by default.
Replacing the [[ -f ~/.bash_functions ]] && . ~/.bash_functions syntax with standard if statements. If statements do not have this same exit code persistence that cause error traps to fail as described here.
running the copy-cannon-env script as described in the readme sets up the default .bashrc file (root/.bashrc). The final 3 lines of this script are:
By default there are no
~/.bash_aliases
or~/.bash_functions
files in user home directories. Using the[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
shorthand causes the exit code 1 to persist after the line is run when no.bash_aliases
file exists.This causes any scripts that call
~/.bashrc
(to set up a conda environment for example) to fail if they are trapping non-zero exit codes (or using set -e). This is the case in the IMI, and it can be a very confusing error for new group members getting set up for the first time.I propose one of the following:
.bash_aliases
and.bash_functions
files that are copied into user run directories by default.[[ -f ~/.bash_functions ]] && . ~/.bash_functions
syntax with standardif
statements. If statements do not have this same exit code persistence that cause error traps to fail as described here.