Skip to content

Commit

Permalink
Add two options to manage_python_env one to do verbose mode so you se…
Browse files Browse the repository at this point in the history
…e the progress bar and another to append any option to the end of the conda install step
  • Loading branch information
ekluzek committed May 17, 2022
1 parent 48800c7 commit 72ce612
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions manage_python_env
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,35 @@ ctsm_python=ctsm_py
# Usage subroutine
usage() {
echo ""
echo "**********************"
echo "***********************************************************************"
echo "usage:"
echo "./manage_python_env"
echo ""
echo "valid arguments: "
echo "[-h|--help] "
echo " Displays this help message"
echo "**********************"
echo "[-v|--verbose] "
echo " Run with verbose mode for the install so you see the progress bar"
echo "[--option <option>] "
echo " Option(s) to pass to 'conda install' step"
echo "***********************************************************************"
}

verbose="No"
option=""
while [ $# -gt 0 ]; do
case $1 in
-h|--help )
usage
exit 0
;;
-v|--verbose )
verbose="Yes"
;;
--option )
option=$2
shift
;;
* )
echo "ERROR:: invalid argument sent in: $2"
usage
Expand All @@ -56,7 +69,11 @@ else
echo "$ctsm_python environment already exists"
fi
echo "Install $ctsm_python this can take a long time, be patient...."
conda install --yes -q -n $ctsm_python --file python/conda_env_ctsm_py.txt
verbosity="-q"
if [ "$verbose" == "Yes" ]; then
verbosity="-v"
fi
conda install --yes $verbosity -n $ctsm_python --file python/conda_env_ctsm_py.txt $option
if [ $? != 0 ]; then
echo "Trouble installing the $ctsm_python python environment"
exit -2
Expand Down

0 comments on commit 72ce612

Please sign in to comment.