From aa98370b8f9f864de284974c15ac4e990239b4b9 Mon Sep 17 00:00:00 2001 From: Daniel D'Avella Date: Mon, 12 Mar 2018 09:18:21 -0400 Subject: [PATCH] More error checking and output in update script --- scripts/update_cubeviz_test_env | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/update_cubeviz_test_env b/scripts/update_cubeviz_test_env index 45caa0920..4f14651cd 100755 --- a/scripts/update_cubeviz_test_env +++ b/scripts/update_cubeviz_test_env @@ -1,9 +1,23 @@ #! /bin/sh +set -eu + conda_env=`conda env list | grep '*' | cut -d\ -f1` +min_conda_version="4.4" -if [ "$conda_env" == "test-cubeviz-conda" ]; then - conda update --update-deps -c glueviz/label/dev -c glueviz -c http://ssb.stsci.edu/astroconda-dev cubeviz --yes -else +if [ "$conda_env" != "test-cubeviz-conda" ]; then echo "Must be in the test-cubeviz-conda conda environment" + exit 1 +fi + +conda_version=$(conda --version | cut -d\ -f2 | cut -d. -f1,2) +if [[ "$conda_version" < "$min_conda_version" ]]; then + echo "WARNING: your conda version is out of date ($(conda --version))." \ + "This may cause issues with installing the latest version of cubeviz" \ + "and its dependencies." fi + +conda update --update-deps -c glueviz/label/dev -c glueviz -c http://ssb.stsci.edu/astroconda-dev cubeviz --yes + +echo "CubeViz test environment has been updated to the following:" +conda list "cubeviz|glue-core|specviz|specutils|spectral-cube"