Hi,
I don't know if this is the right place to share this but I made a small bash script that automatically downloads the latest Ludii version, makes it executable and launches it.
It requires curl (and java to run Ludii) and should work on Mac and Linux.
The forum doesn't allow me to add it as an attachment, so here's the code:
This can be saved as a bash file (e.g. Ludii.sh) and ran through the terminal ( `sh Ludii.sh` ).
Let me know if you have any comments.
Best,
Fabio
I don't know if this is the right place to share this but I made a small bash script that automatically downloads the latest Ludii version, makes it executable and launches it.
It requires curl (and java to run Ludii) and should work on Mac and Linux.
The forum doesn't allow me to add it as an attachment, so here's the code:
Code:
#!/bin/sh
LUDII_SERVER_VERSION=$(curl -s -N https://ludii.games/download.php | grep -o -m 1 "Ludii.*\.jar")
if [ "${LUDII_SERVER_VERSION}" = "" ]; then
echo "Unable to determine latest Ludii version"
fi
LUDII_LOCAL_VERSION=$(ls | grep -o -m 1 "Ludii.*\.jar")
if [ "${LUDII_SERVER_VERSION}" != "${LUDII_LOCAL_VERSION}" ]; then
echo "Found newer version of Ludii: $LUDII_SERVER_VERSION";
echo "Downloading newer version..."
wget -q "https://ludii.games/downloads/$LUDII_SERVER_VERSION";
if [ $? -eq 0 ]; then
echo "Removing old version..."
rm -f "$LUDII_LOCAL_VERSION";
else
echo "Unable to retrieve from server (code $?)"
fi
else
echo "Your version is up to date"
fi
LUDII_LOCAL_VERSION=$(ls | grep -o -m 1 "Ludii.*\.jar")
if [ "${LUDII_LOCAL_VERSION}" != "" ]; then
echo "Launching $LUDII_LOCAL_VERSION"
chmod +x "$LUDII_LOCAL_VERSION";
java -jar "$LUDII_LOCAL_VERSION" > /dev/null &
else
echo "No ludii file found"
fi
This can be saved as a bash file (e.g. Ludii.sh) and ran through the terminal ( `sh Ludii.sh` ).
Let me know if you have any comments.
Best,
Fabio