Mercurial > repos > siwaa > gama
comparison src/MY_gama-headless.sh @ 0:f895e266b37a draft
planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/use/-/tree/gama/GAMA/galaxy-tools commit 67d85c013c62c16392b4796af86836b1334f2eef
| author | siwaa |
|---|---|
| date | Tue, 04 Jun 2024 15:18:01 +0000 |
| parents | |
| children | 39b499a105c9 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:f895e266b37a |
|---|---|
| 1 #!/bin/bash | |
| 2 | |
| 3 javaVersion=$(java -version 2>&1 | head -n 1 | cut -d "\"" -f 2) | |
| 4 # Check if good Java version before everything | |
| 5 if [[ ${javaVersion:2} == 17 ]]; then | |
| 6 echo "You should use Java 17 to run GAMA" | |
| 7 echo "Found you using version : $javaVersion" | |
| 8 exit 1 | |
| 9 fi | |
| 10 | |
| 11 memory="0" | |
| 12 | |
| 13 for arg do | |
| 14 shift | |
| 15 case $arg in | |
| 16 -m) | |
| 17 memory="${1}" | |
| 18 shift | |
| 19 ;; | |
| 20 *) | |
| 21 set -- "$@" "$arg" | |
| 22 ;; | |
| 23 esac | |
| 24 done | |
| 25 | |
| 26 if [[ $memory == "0" ]]; then | |
| 27 memory=$(grep Xmx "$( dirname $( realpath "${BASH_SOURCE[0]}" ) )"/../Gama.ini || echo "-Xmx4096m") | |
| 28 else | |
| 29 memory=-Xmx$memory | |
| 30 fi | |
| 31 | |
| 32 workspaceCreate=0 | |
| 33 case "$@" in | |
| 34 *-help*|*-version*|*-validate*|*-test*|*-xml*|*-batch*|*-write-xmi*|*-socket*) | |
| 35 workspaceCreate=1 | |
| 36 ;; | |
| 37 esac | |
| 38 | |
| 39 | |
| 40 echo "******************************************************************" | |
| 41 echo "* GAMA version 1.9.1 *" | |
| 42 echo "* http://gama-platform.org *" | |
| 43 echo "* (c) 2007-2023 UMI 209 UMMISCO IRD/SU & Partners *" | |
| 44 echo "******************************************************************" | |
| 45 passWork=.workspace | |
| 46 # w/ output folder | |
| 47 if [ $workspaceCreate -eq 0 ]; then | |
| 48 # create output folder if not existing | |
| 49 if [ ! -d "${@: -1}" ]; then | |
| 50 mkdir ${@: -1} | |
| 51 fi | |
| 52 # create workspace in output folder | |
| 53 passWork=${@: -1}/.workspace$(find ${@: -1} -name ".workspace*" | wc -l) | |
| 54 mkdir -p $passWork | |
| 55 | |
| 56 # w/o output folder | |
| 57 else | |
| 58 # create workspace in current folder | |
| 59 passWork=.workspace$(find ./ -maxdepth 1 -name ".workspace*" | wc -l) | |
| 60 fi | |
| 61 | |
| 62 #if ! java -cp "$( dirname $( realpath "${BASH_SOURCE[0]}" ) )"/../plugins/org.eclipse.equinox.launcher*.jar -Xms512m $memory -Djava.awt.headless=true org.eclipse.core.launcher.Main -configuration "$( dirname $( realpath "${BASH_SOURCE[0]}" ) )"/configuration -application msi.gama.headless.product -data $passWork "$@"; then | |
| 63 MY_TEMP_DIR=. | |
| 64 if ! java -cp "$( dirname $( realpath "${BASH_SOURCE[0]}" ) )"/../plugins/org.eclipse.equinox.launcher*.jar -Xms512m $memory -Djava.io.tmpdir=$MY_TEMP_DIR -Djava.awt.headless=true org.eclipse.core.launcher.Main -configuration "$( dirname $( realpath "${BASH_SOURCE[0]}" ) )"/configuration -application msi.gama.headless.product -data $passWork "$@"; then | |
| 65 echo "Error in you command, here's the log :" | |
| 66 cat $passWork/.metadata/.log | |
| 67 exit 1 | |
| 68 fi | |
| 69 |
