-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·34 lines (27 loc) · 1.08 KB
/
build.sh
File metadata and controls
executable file
·34 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e
cd "$(dirname "$0")"
# Extract version from source
VERSION=$(grep "HONE_VERSION" src/workbench/version.ts | sed "s/.*'\(.*\)'.*/\1/")
echo "Building Hone IDE v${VERSION}..."
echo "Compiling Hone IDE..."
perry compile src/app.ts --output hone-ide
echo "Updating app bundle..."
cp hone-ide Hone-macOS.app/Contents/MacOS/Hone
cp Hone.icns Hone-macOS.app/Contents/Resources/Hone.icns
cp hone-icon.png Hone-macOS.app/Contents/MacOS/hone-icon.png
# Stamp version into Info.plist
if [ -f Hone-macOS.app/Contents/Info.plist ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION" Hone-macOS.app/Contents/Info.plist 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $VERSION" Hone-macOS.app/Contents/Info.plist 2>/dev/null || true
fi
echo "Done. Run with: open Hone-macOS.app"
# Create distributable artifact
if [ "${1}" = "--dist" ]; then
ARCH=$(uname -m)
ARTIFACT="Hone-macOS-${ARCH}-${VERSION}.tar.gz"
echo "Creating distributable: ${ARTIFACT}"
tar czf "${ARTIFACT}" Hone-macOS.app/
echo "SHA-256:"
shasum -a 256 "${ARTIFACT}"
fi