Created
December 6, 2021 22:51
-
-
Save alanocallaghan/6cfca73d80395842cd154874762bd2e3 to your computer and use it in GitHub Desktop.
Bash script for activating a conda environment with snakemake on a cluster. One argument - the conda environment. Use it like shell.prefix("./act-conda-sm-clust.sh env; ")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
if [ -f ~/miniconda3/etc/profile.d/conda.sh ]; then | |
[ -z "${CONDA_EXE}" ] && echo "Error, missing \$CONDA_EXE !" && exit 1 | |
CONDA_BASE=$(${CONDA_EXE} info --base) | |
ADDR2LINE="" | |
source $CONDA_BASE/etc/profile.d/conda.sh | |
conda activate $1 || exit 1 | |
fi | |
set +eu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment