-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbundle_pingbar_app.sh
More file actions
executable file
·44 lines (34 loc) · 968 Bytes
/
Copy pathbundle_pingbar_app.sh
File metadata and controls
executable file
·44 lines (34 loc) · 968 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
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
APP_NAME="PingBar"
BUILD_DIR=".build/release"
EXECUTABLE="$BUILD_DIR/$APP_NAME"
APP_BUNDLE="$APP_NAME.app"
CONTENTS_DIR="$APP_BUNDLE/Contents"
MACOS_DIR="$CONTENTS_DIR/MacOS"
RESOURCES_DIR="$CONTENTS_DIR/Resources"
# Build release version if executable doesn't exist
if [ ! -f "$EXECUTABLE" ]; then
echo "Building release version..."
swift build -c release
fi
# Clean up any previous bundle
rm -rf "$APP_BUNDLE"
# Create bundle structure
mkdir -p "$MACOS_DIR" "$RESOURCES_DIR"
# Copy executable
cp "$EXECUTABLE" "$MACOS_DIR/"
# Copy Info.plist
cp Info.plist "$CONTENTS_DIR/Info.plist"
# Copy icon if it exists
if [ -f "PingBar.icns" ]; then
cp PingBar.icns "$RESOURCES_DIR/"
fi
# Make executable
chmod +x "$MACOS_DIR/$APP_NAME"
echo "Created $APP_BUNDLE"
# Optional: Create a symlink for easy access
if [ "$1" = "--link" ]; then
ln -sf "$(pwd)/$APP_BUNDLE" ~/Applications/
echo "Linked to ~/Applications/$APP_BUNDLE"
fi