Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use mktemp in conda-update script, refactor out into contrib and have…
… post-merge and post-checkout call the script
- Loading branch information
Showing
4 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,3 @@ | ||
#!/bin/bash | ||
|
||
function cmd_exists() { | ||
if hash $@ 2> /dev/null ; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
# if conda is available | ||
if cmd_exists "conda"; then | ||
# if a conda environment is active | ||
if [ ! -z "$CONDA_DEFAULT_ENV" ]; then | ||
# update the conda environment to install the requirements specified | ||
if [ "$(uname)" == "Darwin" ]; then | ||
# some conda packages dont exist on OSX | ||
cat requirements-conda.txt | grep -v kraken > /tmp/requirements-conda.txt | ||
else | ||
# for linux, just use requirements-conda as-is | ||
cp requirements-conda.txt /tmp/requirements-conda.txt | ||
fi | ||
|
||
conda install -y -c bioconda --file /tmp/requirements-conda.txt | ||
fi | ||
fi | ||
./contrib/update-conda-env.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./contrib/update-conda-env.sh |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
function cmd_exists() { | ||
if hash $@ 2> /dev/null ; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
} | ||
|
||
requirements_file="$(mktemp -t requirements-conda.txt)" | ||
|
||
# if conda is available | ||
if cmd_exists "conda"; then | ||
# if a conda environment is active | ||
if [ ! -z "$CONDA_DEFAULT_ENV" ]; then | ||
# update the conda environment to install the requirements specified | ||
if [ "$(uname)" == "Darwin" ]; then | ||
# some conda packages dont exist on OSX | ||
cat requirements-conda.txt | grep -v kraken > "$requirements_file" | ||
else | ||
# for linux, just use requirements-conda as-is | ||
cp requirements-conda.txt "$requirements_file" | ||
fi | ||
|
||
conda install -y -c bioconda --file "$requirements_file" | ||
rm "$requirements_file" | ||
fi | ||
fi |