5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 08:20:28 +00:00

Some comments

This commit is contained in:
Neil Alexander 2019-11-28 13:00:52 +00:00
parent 9c113c05bf
commit 3f29a2ff05
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -1,5 +1,12 @@
#!/bin/sh #!/bin/sh
# This script generates an MSI file for Yggdrasil for a given architecture. It
# needs to run on Windows within MSYS2 and Go 1.13 or later must be installed on
# the system and within the PATH. This is ran currently by Appveyor (see
# appveyor.yml in the repository root) for both x86 and x64.
#
# Author: Neil Alexander <neilalexander@users.noreply.github.com>
# Get arch from command line if given # Get arch from command line if given
PKGARCH=$1 PKGARCH=$1
if [ "${PKGARCH}" == "" ]; if [ "${PKGARCH}" == "" ];
@ -8,7 +15,9 @@ then
exit 1 exit 1
fi fi
# Get the rest of the repository history # Get the rest of the repository history. This is needed within Appveyor because
# otherwise we don't get all of the branch histories and therefore the semver
# scripts don't work properly.
if [ "${APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH}" != "" ]; if [ "${APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH}" != "" ];
then then
git fetch --all git fetch --all
@ -19,9 +28,8 @@ then
git checkout ${APPVEYOR_REPO_BRANCH} git checkout ${APPVEYOR_REPO_BRANCH}
fi fi
# Install prerequisites # Install prerequisites within MSYS2
pacman -S --needed --noconfirm unzip git curl pacman -S --needed --noconfirm unzip git curl
# export PATH=$PATH:/c/go/bin/
# Download the wix tools! # Download the wix tools!
if [ ! -d wixbin ]; if [ ! -d wixbin ];
@ -39,13 +47,12 @@ then
) )
fi fi
# Check the prerequisite files are in place # Build Yggdrasil!
[ "${PKGARCH}" == "x64" ] && GOOS=windows GOARCH=amd64 CGO_ENABLED=0 ./build [ "${PKGARCH}" == "x64" ] && GOOS=windows GOARCH=amd64 CGO_ENABLED=0 ./build
[ "${PKGARCH}" == "x86" ] && GOOS=windows GOARCH=386 CGO_ENABLED=0 ./build [ "${PKGARCH}" == "x86" ] && GOOS=windows GOARCH=386 CGO_ENABLED=0 ./build
# Create the postinstall script # Create the postinstall script
cat > config.bat << EOF cat > config.bat << EOF
if exist yggdrasil.conf ( if exist yggdrasil.conf (
move yggdrasil.conf yggdrasil.conf.backup move yggdrasil.conf yggdrasil.conf.backup
yggdrasil.exe -useconffile yggdrasil.conf.backup -normaliseconf > yggdrasil.conf yggdrasil.exe -useconffile yggdrasil.conf.backup -normaliseconf > yggdrasil.conf