-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert-safari.sh
More file actions
64 lines (56 loc) · 1.92 KB
/
convert-safari.sh
File metadata and controls
64 lines (56 loc) · 1.92 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# =============================================================
# convert-safari.sh
# Converts the GitHub Issue Cleaner extension into a Safari
# Web Extension Xcode project using Apple's converter tool.
#
# Requirements:
# - macOS 14 (Sonoma) or later
# - Xcode 15+ with command-line tools installed
# - Safari 17+
#
# Usage:
# chmod +x convert-safari.sh
# ./convert-safari.sh
# =============================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
EXT_DIR="$SCRIPT_DIR"
OUTPUT_DIR="$SCRIPT_DIR/safari-xcode-project"
echo "🧹 GitHub Issue Cleaner — Safari Conversion"
echo "============================================"
echo ""
# Check for macOS
if [[ "$(uname)" != "Darwin" ]]; then
echo "❌ This script must be run on macOS."
echo " Safari Web Extensions require Xcode and the"
echo " safari-web-extension-converter tool."
exit 1
fi
# Check for Xcode command-line tools
if ! xcrun --find safari-web-extension-converter &>/dev/null; then
echo "❌ safari-web-extension-converter not found."
echo " Install Xcode 15+ and run: xcode-select --install"
exit 1
fi
echo "✅ macOS detected"
echo "✅ safari-web-extension-converter found"
echo ""
echo "Converting extension at: $EXT_DIR"
echo "Output Xcode project: $OUTPUT_DIR"
echo ""
# Run the converter
xcrun safari-web-extension-converter "$EXT_DIR" \
--project-location "$OUTPUT_DIR" \
--app-name "GitHub Issue Cleaner" \
--bundle-identifier "com.git-tidy.extension" \
--no-prompt
echo ""
echo "✅ Xcode project created at: $OUTPUT_DIR"
echo ""
echo "Next steps:"
echo " 1. Open the Xcode project: open \"$OUTPUT_DIR/GitHub Issue Cleaner/GitHub Issue Cleaner.xcodeproj\""
echo " 2. Select your development team in Xcode signing settings"
echo " 3. Build & Run (⌘R) to install in Safari"
echo " 4. Enable the extension in Safari → Settings → Extensions"
echo ""