This repository has been archived on 2021-05-10. You can view files and clone it, but cannot push or open issues or pull requests.
2021-03-20 17:28:40 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
getVersionFromLatestRelease() {
|
|
|
|
version=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \
|
|
|
|
| grep "tag_name" \
|
|
|
|
| cut -d '"' -f 4 \
|
|
|
|
| sed -e "s/v//"`
|
|
|
|
|
|
|
|
echo "$version"
|
|
|
|
}
|
|
|
|
|
|
|
|
downloadLatestRelease() {
|
|
|
|
URL=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \
|
|
|
|
| grep "browser_download_url" \
|
|
|
|
| cut -d '"' -f 4`
|
|
|
|
echo "Url: $URL"
|
|
|
|
|
|
|
|
curl -sL -o $1 ${URL}
|
|
|
|
}
|
|
|
|
|
|
|
|
LATEST=`getVersionFromLatestRelease`
|
|
|
|
SEMVER=( ${LATEST//./ } )
|
|
|
|
|
|
|
|
MAJOR=${SEMVER[0]}
|
|
|
|
MINOR=${SEMVER[0]}.${SEMVER[1]}
|
|
|
|
PATCH=$LATEST
|
|
|
|
|
2021-03-20 17:41:30 +00:00
|
|
|
echo "latest,$MAJOR,$MINOR,$PATCH" > .tags
|
2021-03-20 17:28:40 +00:00
|
|
|
|
|
|
|
downloadLatestRelease "files.zip"
|
|
|
|
|
|
|
|
if [ ! -f "./files.zip" ]; then
|
|
|
|
echo "Download ./files.zip does not exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
unzip files.zip -d files
|
|
|
|
|
|
|
|
if [ ! -d "./files" ]; then
|
|
|
|
echo "Directory ./files does not exist"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "./files/index.html" ]; then
|
|
|
|
echo "File ./files/index.html does not exist"
|
|
|
|
exit 1
|
2021-03-20 17:34:53 +00:00
|
|
|
fi
|