-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·30 lines (22 loc) · 923 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·30 lines (22 loc) · 923 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
# Builds the extension (Vite → dist/) and packs dist/ into a release zip.
# dist/ is a complete, loadable extension: the Vue app bundled to dist/roster.js
# plus the copied content/background/injected scripts, page CSS, manifest, icons.
set -euo pipefail
cd "$(dirname "$0")"
# Build the Vue app + copy static files into dist/.
npm run build
# Pull the version out of manifest.json (no jq dependency).
VERSION=$(grep -oE '"version"[[:space:]]*:[[:space:]]*"[^"]+"' manifest.json \
| head -n1 | grep -oE '[0-9]+(\.[0-9]+)*')
if [[ -z "$VERSION" ]]; then
echo "error: could not read version from manifest.json" >&2
exit 1
fi
OUT_DIR=web-ext-artifacts
OUT="$OUT_DIR/roster_extension-$VERSION.zip"
mkdir -p "$OUT_DIR"
rm -f "$OUT"
# Zip the *contents* of dist/ (so manifest.json sits at the zip root).
( cd dist && zip -r -FS "../$OUT" . -x '*.DS_Store' >/dev/null )
echo "built $OUT"