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
This commit is contained in:
David Baker 2016-11-25 19:57:08 +00:00
parent f9afa79b01
commit 693867f074
2 changed files with 67 additions and 0 deletions

13
scripts/check-electron.sh Executable file
View File

@ -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 "***************************************************"

54
scripts/electron-dist.sh Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
set -e
set -x
if [ $# = 0 ]; then
echo "Usage: $0 <target directory>"
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."