From 65c9b05cff1fd52538337bdb52d04f6a60fae9fb Mon Sep 17 00:00:00 2001 From: Cameron Hyde Date: Thu, 9 Nov 2023 14:33:21 +1000 Subject: [PATCH] planemo setup script --- .../workshops/incob/planemo_setup_unix.sh | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/training/workshops/incob/planemo_setup_unix.sh b/training/workshops/incob/planemo_setup_unix.sh index a07f8152..e73389f0 100755 --- a/training/workshops/incob/planemo_setup_unix.sh +++ b/training/workshops/incob/planemo_setup_unix.sh @@ -9,15 +9,29 @@ if [[ "$1" = @("-h"|"--help") ]]; then exit 0 fi +printf "\nThis script will download and build Galaxy release 23.1, and configure planemo to use it.\n" +read -p "Continue? [y/n] " -n 1 -r +echo "" + +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Aborting" + exit 1 +fi + cd ~/.planemo/ -echo "" -echo "Downloading Galaxy release 23.1.1..." -echo "" -wget https://github.com/galaxyproject/galaxy/archive/refs/tags/v23.1.1.tar.gz -echo "Extracting archive..." -tar -xzf v23.1.1.tar.gz -rm v23.1.1.tar.gz +if [ ! -d v23.1.1.tar.gz ] && [ ! -d galaxy-23.1.1 ]; then + echo "" + echo "Downloading Galaxy release 23.1.1..." + echo "" + wget https://github.com/galaxyproject/galaxy/archive/refs/tags/v23.1.1.tar.gz +fi + +if [ ! -d galaxy-23.1.1 ]; then + echo "Extracting archive..." + tar -xzf v23.1.1.tar.gz + rm v23.1.1.tar.gz +fi echo "" echo "Building Galaxy client..." @@ -25,10 +39,16 @@ cd galaxy-23.1.1 make client echo "" -echo "" -echo "Configuring Planemo..." -echo "" >> ~/.planemo.yml -echo "galaxy_root: $PWD/galaxy-23.1.1" >> ~/.planemo.yml +if [[ "$(grep -E '^\w?galaxy_root' ~/.planemo.yml)" != "" ]]; then + echo "" + echo "Configuring Planemo..." + echo "" >> ~/.planemo.yml + echo "galaxy_root: $PWD/galaxy-23.1.1" + echo "galaxy_root: $PWD/galaxy-23.1.1" >> ~/.planemo.yml +else + echo "galaxy_root already configured in ~/.planemo.yml. Please ensure this is correct:" + echo "$(grep -E '^\w?galaxy_root' ~/.planemo.yml)" +fi echo "" echo "Done"