diff build.sh @ 6:7a6f2380fc1d draft

planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
author metexplore
date Wed, 17 May 2023 13:26:37 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.sh	Wed May 17 13:26:37 2023 +0000
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Check if an argument has been provided for the replacement value
+if [ -z "$1" ]; then
+  echo "Usage: $0 version_number"
+  exit 1
+fi
+
+rm -rf build
+
+mkdir -p build/tools
+
+cp -RL tools/*/* build/tools
+
+# cp -RL data build
+
+cp .shed.yml build
+
+# Get the replacement value from the first argument
+# Replace all the "/" by "_"
+replacement_value=$(echo "$1" | sed 's/\//_/g')
+
+# Find all XML files containing the text "MET4J_VERSION_TEST"
+find "build/tools" -type f -name "*.xml" -exec grep -l "MET4J_VERSION_TEST" {} \; | while read file
+do
+  # Replace the text "MET4J_VERSION_TEST" with the replacement value specified in the program argument
+  sed -i "s/MET4J_VERSION_TEST/$replacement_value/g" "$file"
+done
\ No newline at end of file