Add script for updating riot-web
This commit is contained in:
parent
fa6fbb9e3c
commit
17b440be69
34
utils/scripts/update-riot-web.sh
Normal file
34
utils/scripts/update-riot-web.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
usage()
|
||||
{
|
||||
printf "Usage: %s version\n" "${0##*/}" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
err()
|
||||
{
|
||||
printf "%s: %s\n" "${0##*/}" "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
isversion()
|
||||
{
|
||||
printf "%s\n" "$*" | grep -Eq "^v[0-9]+\.[0-9]+\.[0-9]+$"
|
||||
}
|
||||
|
||||
if [ -z "${RIOT_WEB_UI_DIR:-}" ]; then
|
||||
err "Environment RIOT_WEB_UI_DIR unset"
|
||||
fi
|
||||
|
||||
if [ $# -ne 1 ] || ! isversion "$1"; then
|
||||
usage
|
||||
fi
|
||||
ver=$1
|
||||
|
||||
GH_BASE_URL=https://github.com/vector-im/riot-web/releases/download
|
||||
|
||||
cd "$RIOT_WEB_UI_DIR" || err "Can't cd to web UI directory"
|
||||
ftp -o - "$GH_BASE_URL/$ver/riot-$ver.tar.gz" | pax -rz ||
|
||||
err "Can't fetch and extract release"
|
||||
rm -f riot && ln -s "riot-$ver" riot ||
|
||||
err "Can't point web UI directory to new release"
|
Loading…
Reference in New Issue
Block a user