-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_app.sh
More file actions
executable file
·34 lines (26 loc) · 853 Bytes
/
Copy pathbuild_app.sh
File metadata and controls
executable file
·34 lines (26 loc) · 853 Bytes
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
#!/bin/bash
# Configuration
APP_NAME="MacPasteNext"
BUILD_DIR=".build/release"
DEST_APP="$APP_NAME.app"
BIN_NAME="$APP_NAME"
echo "Building $APP_NAME..."
swift build -c release
if [ $? -ne 0 ]; then
echo "Build failed!"
exit 1
fi
echo "Updating $DEST_APP/Contents/MacOS/$BIN_NAME..."
# Ensure the directory exists
mkdir -p "$DEST_APP/Contents/MacOS"
# Copy the universal binary (if created) or the default one
if [ -f ".build/apple/Products/Release/$BIN_NAME" ]; then
cp ".build/apple/Products/Release/$BIN_NAME" "$DEST_APP/Contents/MacOS/$BIN_NAME"
else
# Fallback to standard release build path
cp ".build/release/$BIN_NAME" "$DEST_APP/Contents/MacOS/$BIN_NAME"
fi
chmod +x "$DEST_APP/Contents/MacOS/$BIN_NAME"
echo "Signing $DEST_APP..."
codesign --force --deep --sign - "$DEST_APP"
echo "Done! You can now run $DEST_APP"