2019-07-18 01:10:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# mac-app: create Mac OS .app distribution. Run this script from the directory
|
|
|
|
# containing the doodad binaries (subdirectory of /dist from git repo root)
|
|
|
|
|
|
|
|
VERSION=`grep -e 'Version =' ../../pkg/branding/branding.go | head -n 1 | cut -d '"' -f 2`
|
2021-04-01 04:22:13 +00:00
|
|
|
INSTALL_ROOT="/opt/sketchy-maze"
|
2021-05-02 19:06:34 +00:00
|
|
|
APP_NAME="Sketchy Maze.app"
|
2019-07-18 01:10:13 +00:00
|
|
|
APP_FOLDER="../../etc/macos/$APP_NAME"
|
|
|
|
APP_CONTENTS="$APP_NAME/Contents"
|
|
|
|
|
|
|
|
if [[ ! -f "./doodle" ]]; then
|
|
|
|
echo Run this script from the directory containing the Doodle binary.
|
|
|
|
echo This is usually at /dist/doodle-VERSION/ relative to the git root.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d "$APP_FOLDER" ]]; then
|
|
|
|
echo "Didn't find Mac .app template relative to current folder."
|
|
|
|
echo "I looked at $APP_FOLDER."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Copy the Mac app template in to current folder.
|
|
|
|
echo Copying template app: $APP_FOLDER
|
|
|
|
cp -r "$APP_FOLDER" ./
|
|
|
|
mkdir -p "$APP_CONTENTS/MacOS"
|
|
|
|
mkdir -p "$APP_CONTENTS/Resources"
|
|
|
|
|
|
|
|
# Copy binaries to /MacOS
|
|
|
|
cp doodle doodad "$APP_CONTENTS/MacOS/"
|
2021-06-20 22:11:03 +00:00
|
|
|
rsync -av ./ --exclude doodle --exclude doodad --exclude "$APP_NAME" "$APP_CONTENTS/Resources/"
|