forked from nsoybean/ai-meeting-memory-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy_audio_helper.sh
More file actions
executable file
·36 lines (30 loc) · 1.23 KB
/
Copy pathcopy_audio_helper.sh
File metadata and controls
executable file
·36 lines (30 loc) · 1.23 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
#!/bin/bash
# === CONFIGURATION ===
APP_NAME="ai_voice_note" # Your Flutter macOS app name
HELPER_NAME="AudioRecorderHelper" # Your Swift binary
SOURCE_BINARY_PATH="./macos/audioRecorderHelper/AudioRecorderHelper/$HELPER_NAME"
APP_BUNDLE_PATH="./build/macos/Build/Products/Release/${APP_NAME}.app"
DEST_PATH="${APP_BUNDLE_PATH}/Contents/Resources/$HELPER_NAME"
CODE_SIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)" # Optional: replace with your identity
# === CHECKS ===
if [ ! -f "$SOURCE_BINARY_PATH" ]; then
echo "❌ Swift helper binary not found at $SOURCE_BINARY_PATH"
exit 1
fi
if [ ! -d "$APP_BUNDLE_PATH" ]; then
echo "❌ App bundle not found at $APP_BUNDLE_PATH"
exit 1
fi
# === COPY ===
mkdir -p "${APP_BUNDLE_PATH}/Contents/Resources"
cp -v "$SOURCE_BINARY_PATH" "$DEST_PATH"
# === MAKE EXECUTABLE ===
chmod +x "$DEST_PATH"
echo "✅ Helper binary copied and marked as executable."
# === (Optional) CODE SIGN ===
if [[ "$CODE_SIGN_IDENTITY" != "Developer ID Application: Your Name (TEAMID)" ]]; then
codesign --timestamp --sign "$CODE_SIGN_IDENTITY" "$DEST_PATH"
echo "🔏 Code signed with identity: $CODE_SIGN_IDENTITY"
else
echo "⚠️ Skipped code signing. Set CODE_SIGN_IDENTITY in script if needed."
fi