-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·50 lines (43 loc) · 1.6 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·50 lines (43 loc) · 1.6 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
#!/bin/bash
set -euo pipefail
# Command Code + Codex Desktop Widget - Build & Package
SDK=$(xcrun --sdk macosx --show-sdk-path)
BIN=".build/CommandCodeCodexWidget"
APP=".build/CommandCodeCodex.app"
CONTENTS="$APP/Contents"
mkdir -p .build
echo "Building..."
swiftc -sdk "$SDK" \
-target arm64-apple-macos26.0 \
-framework SwiftUI -framework AppKit -framework Combine -framework Foundation \
-O \
-o "$BIN" \
Sources/Diag.swift \
Sources/Models.swift \
Sources/TokenExtractor.swift \
Sources/DataFetcher.swift \
Sources/CodexFetcher.swift \
Sources/App.swift
echo "Packaging .app bundle..."
mkdir -p "$CONTENTS/MacOS" "$CONTENTS/Resources"
cp "$BIN" "$CONTENTS/MacOS/CommandCodeCodexWidget"
cat > "$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>CommandCodeCodexWidget</string>
<key>CFBundleDisplayName</key><string>Command Code + Codex Widget</string>
<key>CFBundleIdentifier</key><string>com.commandcode.codex-desktop-widget</string>
<key>CFBundleExecutable</key><string>CommandCodeCodexWidget</string>
<key>CFBundleVersion</key><string>1</string>
<key>CFBundleShortVersionString</key><string>1.0.0</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>LSMinimumSystemVersion</key><string>26.0</string>
<key>LSUIElement</key><true/>
<key>NSHighResolutionCapable</key><true/>
</dict>
</plist>
PLIST
cat > "$CONTENTS/PkgInfo" <<< 'APPL????'
echo "Done. Launch with: open $APP"