add laby.bat to run it on windows systems

- build is still on linux only ( shell untested )
- generate laby.bat
This commit is contained in:
philippe lhardy
2020-10-14 18:47:43 +02:00
parent 046a7767a8
commit cc4b03ee4d
2 changed files with 39 additions and 1 deletions

View File

@@ -1,5 +1,19 @@
#!/bin/bash
function findmainjar()
{
for MJ in $(find . -name "*.jar")
do
echo "$MJ"
if [[ $MJ =~ (artloglaby-.*\.jar) ]]
then
MAINJAR=${BASH_REMATCH[1]}
echo "found $MJ jar $MAINJAR"
fi
done
}
specific_run()
{
local action=$1
@@ -35,8 +49,23 @@ create_zip_package()
mkdir $dest/lab
mkdir $dest/libs
cp scripts/laby.sh $dest
MAINJAR=""
pushd dist/lib
findmainjar
popd
if [[ -n $MAINJAR ]]
then
printf '%b\n' "java -jar $MAINJAR"
printf '%b\r\n' "java -jar $MAINJAR" >$dest/laby.bat
else
echo "[ERROR] can't find main jar"
fi
cp LISEZMOI $dest
cp libs/* $dest/libs/
cp libs/* $dest/libs/
cp dist/lib/* $dest
zip -r $zip_package $dest