-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
路54 lines (43 loc) 路 1.16 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
路54 lines (43 loc) 路 1.16 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
EXTENSION_DIR="${ROOT_DIR}/extension"
MANIFESTS_DIR="${EXTENSION_DIR}/manifests"
OUTPUT_DIR="${ROOT_DIR}/release"
TARGETS=(chrome edge firefox)
command -v rsync >/dev/null 2>&1 || {
echo "error: rsync is required" >&2
exit 1
}
command -v zip >/dev/null 2>&1 || {
echo "error: zip is required" >&2
exit 1
}
command -v node >/dev/null 2>&1 || {
echo "error: node is required" >&2
exit 1
}
mkdir -p "${OUTPUT_DIR}"
for target in "${TARGETS[@]}"; do
manifest="${MANIFESTS_DIR}/${target}.json"
if [[ ! -f "${manifest}" ]]; then
echo "error: manifest not found for ${target}: ${manifest}" >&2
exit 1
fi
version="$(node -e "console.log(require(process.argv[1]).version)" "${manifest}")"
archive="${OUTPUT_DIR}/muslimboard-${target}-v${version}.zip"
stage="$(mktemp -d)"
rsync -a \
--exclude "manifests" \
--exclude ".DS_Store" \
"${EXTENSION_DIR}/" \
"${stage}/"
cp "${manifest}" "${stage}/manifest.json"
rm -f "${archive}"
(
cd "${stage}"
zip -qr "${archive}" .
)
rm -rf "${stage}"
echo "created ${archive}"
done