-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
52 lines (46 loc) · 1.17 KB
/
build.sh
File metadata and controls
52 lines (46 loc) · 1.17 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
#!/bin/bash
# Build script for Chrome Web Store submission
# Creates a clean ZIP file with only the extension files
# Works on both Linux/Mac (zip) and Windows (PowerShell)
set -e
EXTENSION_NAME="hintcode"
VERSION=$(grep '"version"' manifest.json | head -1 | sed 's/.*: "\(.*\)".*/\1/')
ZIP_NAME="${EXTENSION_NAME}-v${VERSION}.zip"
echo "Building ${ZIP_NAME}..."
# Remove old zip if exists
rm -f "$ZIP_NAME"
if command -v zip &> /dev/null; then
zip -r "$ZIP_NAME" \
manifest.json \
background/ \
content-scripts/ \
icons/ \
lib/ \
options/ \
popup/ \
sidepanel/ \
styles/ \
-x "*.DS_Store" "*__MACOSX*"
else
# Windows fallback using PowerShell
powershell -Command "
\$files = @(
'manifest.json',
'background',
'content-scripts',
'icons',
'lib',
'options',
'popup',
'sidepanel',
'styles'
)
if (Test-Path '$ZIP_NAME') { Remove-Item '$ZIP_NAME' }
Compress-Archive -Path \$files -DestinationPath '$ZIP_NAME'
"
fi
echo ""
echo "Created: $ZIP_NAME"
ls -lh "$ZIP_NAME" | awk '{print "Size:", $5}'
echo ""
echo "Upload this file to: https://chrome.google.com/webstore/devconsole"