-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·30 lines (23 loc) · 974 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·30 lines (23 loc) · 974 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APP_PATH="$(/bin/bash "$ROOT_DIR/build.sh")"
DEST_DIR="/Applications"
DEST_APP="$DEST_DIR/Codex Account Switcher.app"
LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister"
mkdir -p "$DEST_DIR"
rm -rf "$DEST_APP"
cp -R "$APP_PATH" "$DEST_APP"
if command -v xattr >/dev/null 2>&1; then
/usr/bin/xattr -cr "$DEST_APP"
/usr/bin/xattr -d com.apple.FinderInfo "$DEST_APP" 2>/dev/null || true
/usr/bin/xattr -d 'com.apple.fileprovider.fpfs#P' "$DEST_APP" 2>/dev/null || true
fi
if command -v codesign >/dev/null 2>&1; then
/usr/bin/codesign --force --deep --sign - "$DEST_APP" >/dev/null
fi
if [[ -x "$LSREGISTER" ]]; then
"$LSREGISTER" -f "$DEST_APP" >/dev/null 2>&1 || true
fi
"$DEST_APP/Contents/MacOS/CodexAccountSwitcher" --install-lifecycle-monitor >/dev/null
echo "$DEST_APP"