diff options
Diffstat (limited to 'get-latest')
-rwxr-xr-x | get-latest | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/get-latest b/get-latest new file mode 100755 index 000000000000..341fe8862fcd --- /dev/null +++ b/get-latest @@ -0,0 +1,14 @@ +#!/bin/sh + +BASEURL="https://github.com/magarena/magarena/releases" + +wget --help | grep -q '\--show-progress' && \ + _PROGRESS_OPT="-q --show-progress" || _PROGRESS_OPT="" + +echo "Getting latest version ..." +VERSION="$(wget -q "$BASEURL" -O - | grep '<a href.*releases/download/.*[^p].zip' | head -1 | perl -pe 's|.*href=".*-(.*).zip".*|\1|g')" + +wget $_PROGRESS_OPT -nc "$BASEURL/download/$VERSION/Magarena-$VERSION.zip" -O magarena-$VERSION.zip +unzip -q magarena-$VERSION.zip +rm -rf magarena-latest +mv -f Magarena-$VERSION magarena-latest |