doodle/scripts/mac-app.sh

33 lines
1.0 KiB
Bash
Raw Normal View History

#!/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`
INSTALL_ROOT="/opt/sketchy-maze"
2021-05-02 19:06:34 +00:00
APP_NAME="Sketchy Maze.app"
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/"