Skip to content

Commit ff550e8

Browse files
authored
Merge pull request #19 from ElcanoTek/codex/debug-terminal-issue-in-mac-app
2 parents 2d72906 + b9a5fdf commit ff550e8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

package_mac.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,25 @@ uvx pyinstaller --noconfirm --console --name Victoria \
88
--add-data "CRUSH.md:." \
99
--add-data "VICTORIA.md:." \
1010
victoria.py
11+
12+
APP="dist/Victoria.app"
13+
MACOS="$APP/Contents/MacOS"
14+
15+
# Rename the compiled binary so we can wrap it with a launcher
16+
mv "$MACOS/Victoria" "$MACOS/victoria-bin"
17+
18+
# Script that actually executes the binary inside a Terminal session
19+
cat > "$MACOS/launch.command" <<'EOF'
20+
#!/bin/bash
21+
DIR="$(cd "$(dirname "$0")" && pwd)"
22+
"$DIR/victoria-bin"
23+
EOF
24+
chmod +x "$MACOS/launch.command"
25+
26+
# Wrapper executable that Finder launches. It opens Terminal and runs the command script.
27+
cat > "$MACOS/Victoria" <<'EOF'
28+
#!/bin/bash
29+
DIR="$(cd "$(dirname "$0")" && pwd)"
30+
open -a Terminal "$DIR/launch.command"
31+
EOF
32+
chmod +x "$MACOS/Victoria"

0 commit comments

Comments
 (0)