annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
1 #!/bin/bash
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
2
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
3 # Check if an argument has been provided for the replacement value
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
4 if [ -z "$1" ]; then
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
5 echo "Usage: $0 version_number"
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
6 exit 1
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
7 fi
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
8
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
9 rm -rf build
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
10
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
11 mkdir -p build/tools
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
12
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
13 cp -RL tools/*/* build/tools
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
14
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
15 # cp -RL data build
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
16
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
17 cp .shed.yml build
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
18
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
19 # Get the replacement value from the first argument
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
20 # Replace all the "/" by "_"
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
21 replacement_value=$(echo "$1" | sed 's/\//_/g')
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
22
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
23 # Find all XML files containing the text "MET4J_VERSION_TEST"
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
24 find "build/tools" -type f -name "*.xml" -exec grep -l "MET4J_VERSION_TEST" {} \; | while read file
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
25 do
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
26 # Replace the text "MET4J_VERSION_TEST" with the replacement value specified in the program argument
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
27 sed -i "s/MET4J_VERSION_TEST/$replacement_value/g" "$file"
7a6f2380fc1d planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
metexplore
parents:
diff changeset
28 done