Skip to content

Commit

Permalink
Add update all
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbenlloch authored and Jacek Generowicz committed Sep 8, 2017
1 parent 4a68042 commit e0680b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bash_manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ manage.sh()
manage.sh)
local opts="make_environment\
update_environment\
update_all\
run_tests\
run_tests_par\
compile_and_test\
Expand All @@ -27,7 +28,7 @@ manage.sh()

if [[ ${prev2} == "manage.sh" ]] ; then
case "${prev}" in
install_and_check|install|work_in_python_version|make_environment)
install_and_check|install|work_in_python_version|make_environment|update_environment)
local versions="3.6"
COMPREPLY=( $(compgen -W "${versions}" -- ${cur}) )
return 0
Expand Down Expand Up @@ -57,6 +58,7 @@ source_manage.sh()
work_in_python_version\
make_environment\
update_environment\
update_all\
run_tests\
run_tests_par\
compile_and_test\
Expand Down
18 changes: 16 additions & 2 deletions manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,23 @@ EOF
}

function update_environment {
source activate IC${PYTHON_VERSION}
conda update --all
update IC${PYTHON_VERSION}
}

function update () {
source activate $1
conda update --all -y
source deactivate
}

function update_all {
ENVS=`conda env list | grep -e "^IC" | awk '{print $1}'`
for e in $ENVS; do
echo "updating $e"
update $e
done
}

function python_version_env {
# Activate the relevant conda env
source activate IC${PYTHON_VERSION}
Expand Down Expand Up @@ -216,6 +228,7 @@ case $COMMAND in
work_in_python_version) work_in_python_version ;;
make_environment) make_environment ;;
update_environment) update_environment ;;
update_all) update_all ;;
run_tests) run_tests ;;
run_tests_par) run_tests_par ;;
compile_and_test) compile_and_test ;;
Expand All @@ -234,6 +247,7 @@ case $COMMAND in
echo "source $THIS work_in_python_version X.Y"
echo "bash $THIS make_environment X.Y"
echo "bash $THIS update_environment X.Y"
echo "bash $THIS update_all"
echo "bash $THIS run_tests"
echo "bash $THIS run_tests_par"
echo "bash $THIS compile_and_test"
Expand Down

0 comments on commit e0680b7

Please sign in to comment.