Deal with Riot -> Element rename
This commit is contained in:
parent
79a12e7ff3
commit
ce2502c113
1 changed files with 4 additions and 3 deletions
41
utils/scripts/update-element-web.sh
Normal file
41
utils/scripts/update-element-web.sh
Normal file
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
# env
|
||||
# Written in 2020 by Lucas
|
||||
# CC0 1.0 Universal/Public domain - No rights reserved
|
||||
#
|
||||
# To the extent possible under law, the author(s) have dedicated all
|
||||
# copyright and related and neighboring rights to this software to the
|
||||
# public domain worldwide. This software is distributed without any
|
||||
# warranty. You should have received a copy of the CC0 Public Domain
|
||||
# Dedication along with this software. If not, see
|
||||
# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||
|
||||
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]+$"
|
||||
}
|
||||
|
||||
[ -n "${ELEMENT_WEB_UI_DIR:-}" ] ||
|
||||
err "environment var ELEMENT_WEB_UI_DIR unset"
|
||||
[ $# -eq 1 ] && isversion "$1" || usage
|
||||
ver=$1
|
||||
|
||||
GH_BASE_URL=https://github.com/vector-im/element-web/releases/download
|
||||
|
||||
cd "$ELEMENT_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…
Add table
Add a link
Reference in a new issue