Notes and photos were stuck on one machine. A small Go/Postgres backend
stores each group's payload under a code that doubles as the shared
secret, so a second Mac just needs the code — no account or login.
Applying a remote change must not push it straight back, otherwise the
two Macs would bump the version back and forth forever, so payloads are
fingerprinted and identical ones are skipped.
💘 Generated with Crush
Assisted-by: Crush:kimi-k3
75 lines
2.2 KiB
Bash
Executable File
75 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
VERSION="${1:-0.1.0}"
|
|
|
|
swift build -c release
|
|
|
|
BIN=".build/release/Prompt"
|
|
APP="Prompt.app"
|
|
IDENT=""
|
|
|
|
# Prefer a Developer ID Application identity so the app gets clean Gatekeeper
|
|
# behavior; fall back to ad-hoc signing (no TCC-stable identity) otherwise.
|
|
if command -v security >/dev/null 2>&1; then
|
|
IDENT=$(security find-identity -v -p codesigning 2>/dev/null | awk '/Developer ID Application:/ { print $2; exit }')
|
|
fi
|
|
|
|
rm -rf "$APP"
|
|
mkdir -p "$APP/Contents/MacOS"
|
|
cp "$BIN" "$APP/Contents/MacOS/Prompt"
|
|
|
|
cat > "$APP/Contents/Info.plist" <<PLIST
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>CFBundleExecutable</key>
|
|
<string>Prompt</string>
|
|
<key>CFBundleIdentifier</key>
|
|
<string>dev.tzgyn.prompt</string>
|
|
<key>CFBundleInfoDictionaryVersion</key>
|
|
<string>6.0</string>
|
|
<key>CFBundleName</key>
|
|
<string>Prompt</string>
|
|
<key>CFBundlePackageType</key>
|
|
<string>APPL</string>
|
|
<key>CFBundleIconFile</key>
|
|
<string>Icon</string>
|
|
<key>CFBundleShortVersionString</key>
|
|
<string>${VERSION}</string>
|
|
<key>CFBundleVersion</key>
|
|
<string>${VERSION}</string>
|
|
<key>LSMinimumSystemVersion</key>
|
|
<string>14.0</string>
|
|
<key>LSUIElement</key>
|
|
<true/>
|
|
<key>NSHighResolutionCapable</key>
|
|
<true/>
|
|
<key>NSPrincipalClass</key>
|
|
<string>NSApplication</string>
|
|
<!-- The sync server URL is user-supplied and may be plain HTTP (a LAN
|
|
address or a self-hosted box), which App Transport Security would
|
|
otherwise block. -->
|
|
<key>NSAppTransportSecurity</key>
|
|
<dict>
|
|
<key>NSAllowsArbitraryLoads</key>
|
|
<true/>
|
|
</dict>
|
|
</dict>
|
|
</plist>
|
|
PLIST
|
|
|
|
chmod +x scripts/make-icon.sh
|
|
./scripts/make-icon.sh
|
|
|
|
if [ -n "$IDENT" ]; then
|
|
security unlock-keychain "$HOME/Library/Keychains/login.keychain-db" 2>/dev/null || true
|
|
codesign --force --options runtime --timestamp --sign "$IDENT" "$APP"
|
|
echo "Built $APP ${VERSION} (signed with Developer ID '$IDENT') — open $APP"
|
|
else
|
|
codesign --force --sign - "$APP"
|
|
echo "Built $APP ${VERSION} (ad-hoc signed) — open $APP"
|
|
fi
|