-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle.sh
More file actions
executable file
·60 lines (53 loc) · 1.7 KB
/
Copy pathbundle.sh
File metadata and controls
executable file
·60 lines (53 loc) · 1.7 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
set -euo pipefail
APP_NAME="Rusty"
BUNDLE_ID="com.rusty.terminal"
VERSION="$(grep '^version' Cargo.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/')"
BINARY="target/release/rusty"
ICON="crates/rusty-ui/assets/icon.icns"
OUT="releases/$APP_NAME.app"
echo "Building release binary..."
cargo build --release -p rusty-app
echo "Assembling $OUT..."
rm -rf "$OUT"
mkdir -p "$OUT/Contents/MacOS"
mkdir -p "$OUT/Contents/Resources"
cp "$BINARY" "$OUT/Contents/MacOS/$APP_NAME"
cp "$ICON" "$OUT/Contents/Resources/$APP_NAME.icns"
# Completion specs — copied into Resources so the bundled binary can find them.
mkdir -p "$OUT/Contents/Resources/completions"
cp completions-toml/*.toml "$OUT/Contents/Resources/completions/"
cat > "$OUT/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>CFBundleName</key>
<string>$APP_NAME</string>
<key>CFBundleDisplayName</key>
<string>$APP_NAME</string>
<key>CFBundleIdentifier</key>
<string>$BUNDLE_ID</string>
<key>CFBundleVersion</key>
<string>$VERSION</string>
<key>CFBundleShortVersionString</key>
<string>$VERSION</string>
<key>CFBundleExecutable</key>
<string>$APP_NAME</string>
<key>CFBundleIconFile</key>
<string>$APP_NAME</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>LSUIElement</key>
<false/>
</dict>
</plist>
PLIST
echo "Done: $OUT"
echo ""
echo "To install: cp -r $OUT /Applications/"
echo "To run now: open $OUT"