# This will be sourced before launching an Apptainer container.
# Any variables prefixed with "APPTAINERENV_" will be transposed
# properly into the container. For example:
# APPTAINERENV_LD_LIBRARY_PATH -> LD_LIBRARY_PATH

# Environment modules if set, cause errors in containers
unset module
unset ml

# Bash env has been known to cause issues in containers
unset BASH_ENV

# Provide a sane path within the container
if [ -z ${APPTAINERENV_PATH+x} ]; then
    APPTAINERENV_PATH="/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
else
    APPTAINERENV_PATH="$APPTAINERENV_PATH:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
fi

# Don't save the shell's HISTFILE
APPTAINERENV_HISTFILE=""

export APPTAINERENV_PATH APPTAINERENV_HISTFILE
