aboutsummaryrefslogtreecommitdiffhomepage
path: root/build.bash
blob: 1af320ce35d8fc14fa26be4b881a8c4b620026f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -euo pipefail

dist="dist/"
BROWSER=$1

rm -rf "$dist"
mkdir "$dist"
find src/ -not -name "*.js" -exec cp '{}' "$dist" \;
cp LICENSE.txt "$dist"
npm run build

cd "$dist"
if [[ $BROWSER = 'chromium' ]]; then
    # the "applications" key is only supported on Firefox
    jq 'del(.applications)' manifest.json > mani.json
    rm manifest.json
    mv mani.json manifest.json
fi

zip archiveror.zip *.js *.html *.css *.png manifest.json LICENSE.txt