- enable running project 'quck' - run the jar in the dist directory directly
- enable running any class directly without needing a jar in the first place
This commit is contained in:
@@ -2,13 +2,25 @@
|
||||
set -uo pipefail
|
||||
|
||||
# when executed as executable file in "git for windows" bash some things won't work, so always run with prefixed command
|
||||
originDir=$(pwd);
|
||||
cd /g/zeitlaeufer/;
|
||||
tmpDir="/tmp/zeitlaeufer_$RANDOM";
|
||||
mkdir $tmpDir;
|
||||
cp dist/zeitlaeufer.jar $tmpDir;
|
||||
cd $originDir;
|
||||
jarDir=/g/zeitlaeufer/dist/;
|
||||
if [[ $# == 0 || ($1 != -quick && $1 != -class) ]]; then
|
||||
tmpDir=/tmp/zeitlaeufer_$RANDOM;
|
||||
mkdir $tmpDir;
|
||||
cp ${jarDir}zeitlaeufer.jar $tmpDir;
|
||||
jarDir=$tmpDir;
|
||||
elif [[ $1 == -quick ]]; then
|
||||
shift;
|
||||
elif [[ $1 == -class ]]; then
|
||||
originDir=$(pwd);
|
||||
cd /g/zeitlaeufer/target/;
|
||||
java de.szimnau.zeitlaeufer.$2;
|
||||
exitCode=$?;
|
||||
cd originDir;
|
||||
return $exitCode;
|
||||
fi
|
||||
# java -jar $tmpDir/zeitlaeufer.jar $@;
|
||||
# -p <=> --module-path | -m <=> --module
|
||||
java --module-path $tmpDir/zeitlaeufer.jar --module zeitlaeufer $@;
|
||||
rm -r $tmpDir;
|
||||
java --module-path $jarDir/zeitlaeufer.jar --module zeitlaeufer $@;
|
||||
if [[ -n $tmpDir && -d $tmpDir ]]; then
|
||||
rm -r $tmpDir;
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user