-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos-app.sh
More file actions
28 lines (28 loc) · 1.08 KB
/
Copy pathmacos-app.sh
File metadata and controls
28 lines (28 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
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
BIN="$ROOT/target/release/sentinel-browser"
if [[ ! -f "$BIN" ]]; then
echo "Build first: cargo build --release -p sentinel-browser" >&2
exit 1
fi
APP="$ROOT/dist/Sentinel.app"
rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp "$BIN" "$APP/Contents/MacOS/sentinel-browser"
chmod +x "$APP/Contents/MacOS/sentinel-browser"
cat > "$APP/Contents/Info.plist" <<EOF
<?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>sentinel-browser</string>
<key>CFBundleIdentifier</key><string>computer.sentinel.browser</string>
<key>CFBundleName</key><string>Sentinel</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleShortVersionString</key><string>0.0.3</string>
<key>CFBundleVersion</key><string>0.0.3</string>
</dict>
</plist>
EOF
echo "Staged $APP (unsigned). xattr -dr com.apple.quarantine $APP if Gatekeeper blocks."