From 693867f0746af51548f8932bc6113b74b8041abd Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 25 Nov 2016 19:57:08 +0000 Subject: [PATCH] Final bits to prepare electron distribtion: * Remove the config: nobody else wants our update URL so we'll keep it separately. Don't copy the config. * Script to yell at you if you've build a package with auto update turned off. * s/vector/webapp/ when looking for config * Use different update URLs for the various platforms --- scripts/check-electron.sh | 13 ++++++++++ scripts/electron-dist.sh | 54 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 scripts/check-electron.sh create mode 100755 scripts/electron-dist.sh diff --git a/scripts/check-electron.sh b/scripts/check-electron.sh new file mode 100755 index 0000000000..82b24a6cc3 --- /dev/null +++ b/scripts/check-electron.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +update_url=`jq .update_url webapp/config.json` +echo "***************************************************" +echo +if [ $? = 0 ]; then + echo "Built electron package with update url: $update_url" +else + echo "Built electron package with no update url" + echo "This build will not auto-update." +fi +echo +echo "***************************************************" diff --git a/scripts/electron-dist.sh b/scripts/electron-dist.sh new file mode 100755 index 0000000000..36f60c9e6e --- /dev/null +++ b/scripts/electron-dist.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e +set -x + +if [ $# = 0 ]; then + echo "Usage: $0 " + echo "" + echo "Adds the build in electron/dist/ to a given Riot electron" + echo "download tree. If target directory is empty, create a new" + echo "download tree. This tree can be placed on a web server to" + echo "serve auto-updates (although auto-update for Mac requires" + echo "additional logic)." + exit +fi + +ver=`basename electron/dist/mac/*.dmg | cut -d '-' -f 2 | sed -e 's/\.dmg$//'` +dir=$1 + +echo "Copying files for version $ver to $dir" + +# Install packages: what the user downloads the first time, +# (DMGs for mac, exe installer for windows) +mkdir -p "$dir/install/macos" +cp electron/dist/mac/*.dmg "$dir/install/macos/" +echo "$ver" > "$dir/install/macos/latest" + +mkdir -p "$dir/install/win32/ia32" +cp electron/dist/win-ia32/*.exe "$dir/install/win32/ia32/" + +mkdir -p "$dir/install/win32/x64" +cp electron/dist/win/*.exe "$dir/install/win32/ia32/" + + +# Packages for auto-update. It would be nice if squirrel's +# auto update used the installer packages, but it doesn't +# for Reasons. zip for mac, nupkg for windows. +mkdir -p "$dir/update/macos" +cp electron/dist/mac/*.zip "$dir/update/macos/" +echo "$ver" > "$dir/update/macos/latest" + +mkdir -p "$dir/update/win32/ia32" +cp electron/dist/win-ia32/*.nupkg "$dir/update/win32/ia32/" +cat electron/dist/win-ia32/RELEASES >> "$dir/update/win32/ia32/RELEASES" +echo >> "$dir/update/win32/ia32/RELEASES" + +mkdir -p "$dir/update/win32/x64" +cp electron/dist/win/*.nupkg "$dir/update/win32/x64/" +cat electron/dist/win/RELEASES >> "$dir/update/win32/x64/RELEASES" +echo >> "$dir/update/win32/x64/RELEASES" + + +echo "All done!" +echo "$dir can now be copied to your web server."