Skip to content

Commit

Permalink
conda env checking before uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Jul 25, 2020
1 parent 85a57fd commit 0315666
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,43 @@ REPO=${1:-"ktmeaton/plague-phylogeography"}

# Number of uninstall steps
STEPS="5"
# Get plague-phylogeography conda name
PHYLO_CONDA_ENV="plague-phylogeography-0.1.4dev"
if [[ -f ~/.nextflow/assets/${REPO}/environment.yaml ]]; then
PHYLO_CONDA_ENV=`grep "name:" ~/.nextflow/assets/${REPO}/environment.yaml | \
cut -d " " -f 2`
fi


#------------------------------------------------------------------------------#
# Remove the plague-phylogeography pipeline and conda environment
PHYLO_CONDA_ENV="plague-phylogeography-0.1.4dev"
echo "[1/${STEPS}] Removing the plague-phylogeography nextflow pipeline."
if [[ -f ~/.nextflow/assets/${REPO}/environment.yaml ]]; then
PHYLO_CONDA_ENV=`grep "name:" ~/.nextflow/assets/${REPO}/environment.yaml | \
cut -d " " -f 2`
nextflow drop ${REPO}
echo "[2/${STEPS}] Removing the plague-phylogeography conda environment."
fi
echo "[2/${STEPS}] Removing the plague-phylogeography conda environment."
if [[ `conda env list | grep ${PHYLO_CONDA_ENV}` ]]; then
conda remove -n ${PHYLO_CONDA_ENV} --all
else
echo "[2/${STEPS}] Removing the plague-phylogeography conda environment...Skip."
fi

# Remove the nfcore/eager pipeline
#------------------------------------------------------------------------------#
# Remove the nfcore/eager pipeline and conda env
EAGER_CONDA_ENV="nf-core-eager-2.2.0dev"
echo "[3/${STEPS}] Removing the nf-core/eager nextflow pipeline."
if [[ -f ~/.nextflow/assets/nf-core/eager/environment.yaml ]]; then
EAGER_CONDA_ENV=`grep "name:" ~/.nextflow/assets/nf-core/eager/environment.yaml | \
EAGER_CONDA_ENV=`grep "name:" ~/.nextflow/assets/nf-core/eager/environment.yaml | \
cut -d " " -f 2`
nextflow drop nf-core/eager
echo "[4/${STEPS}] Removing the nf-core/eager conda environment."
fi
echo "[4/${STEPS}] Removing the nf-core/eager conda environment."
if [[ `conda env list | grep ${EAGER_CONDA_ENV}` ]]; then
conda remove -n ${EAGER_CONDA_ENV} --all
else
echo "[4/${STEPS}] Removing the nf-core/eager conda environment...Skip."
fi

#------------------------------------------------------------------------------#
# Remove the nextstrain conda env
NEXTSTRAIN_CONDA_ENV="nextstrain-8.0.0"
echo "[5/${STEPS}] Removing the nextstrain conda environment."
if [[ -f ~/.nextflow/assets/${REPO}/config/nextstrain.yaml ]]; then
NEXTSTRAIN_CONDA_ENV=`grep "name:" ~/.nextflow/assets/${REPO}/config/nextstrain.yaml | \
cut -d " " -f 2`
fi
if [[ `conda env list | grep ${NEXTSTRAIN_CONDA_ENV}` ]]; then
conda remove -n ${NEXTSTRAIN_CONDA_ENV} --all
fi

0 comments on commit 0315666

Please sign in to comment.