Files
UltraGrid/data/update.mac
Martin Pulec ee889d4c2e Mac updater: use cURL
We do not use the date in the nightly build names any more.
2020-02-24 13:47:20 +01:00

37 lines
722 B
Bash
Executable File

#!/bin/sh -eu
APPNAME=uv-qt.app
DIR=$(cd $(dirname $0)/../..; pwd)
if [ $(expr x$0 : x/) -eq 0 ]; then
echo "Cannot update when not running with an absolute path!" 1>&2
exit 1
fi
if [ $(expr x$0 : x/Volumes) -gt 0 ]; then
echo "Refusing update of mounted image!" 1>&2
exit 1
fi
if [ $(basename $DIR) != $APPNAME ]; then
echo "Application name is not ending with $APPNAME" 1>&2
exit 1
fi
UPDATER_DIR=$(mktemp -d /tmp/ug-updater.XXXXXXXX)
cd $UPDATER_DIR
curl -LO https://github.com/CESNET/UltraGrid/releases/download/nightly/UltraGrid-nightly.dmg
mkdir mnt
hdiutil mount -mountpoint mnt *dmg
rm -rf $DIR
cp -r mnt/$APPNAME $DIR
umount mnt
cd -
rm -rf $UPDATER_DIR