-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathsync-safari.sh
More file actions
executable file
·22 lines (17 loc) · 1.01 KB
/
Copy pathsync-safari.sh
File metadata and controls
executable file
·22 lines (17 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
set -euo pipefail
# Sync the extension source into the Safari Xcode project's resources.
# Run after changing manifest.json, src/, data/, options/, onboarding/, or
# icons/, then rebuild safari/Knockoff/Knockoff.xcodeproj.
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
RES_DIR="$ROOT_DIR/safari/Knockoff/Knockoff Extension/Resources"
rsync -a --delete "$ROOT_DIR/src" "$ROOT_DIR/data" "$ROOT_DIR/options" "$ROOT_DIR/onboarding" "$ROOT_DIR/icons" "$RES_DIR/"
cp "$ROOT_DIR/manifest.json" "$RES_DIR/manifest.json"
# Keep the marketing version in step with the manifest. This is a global
# replace, so it covers every target's MARKETING_VERSION line — the macOS app,
# the iOS app, and the extension.
VERSION=$(node -e "console.log(require('$ROOT_DIR/manifest.json').version)")
sed -i '' "s/MARKETING_VERSION = [^;]*;/MARKETING_VERSION = $VERSION;/" \
"$ROOT_DIR/safari/Knockoff/Knockoff.xcodeproj/project.pbxproj"
echo "Synced extension into Safari project (v$VERSION)."