forked from Loirooriol/tab-counter-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
42 lines (32 loc) · 1022 Bytes
/
build.sh
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
#!/bin/bash
set -e
mkdir -p artifacts
declare -a IGNORE_FILES
IGNORE_FILES[${#IGNORE_FILES[@]}]='**/.*.sw*'
IGNORE_FILES[${#IGNORE_FILES[@]}]='**/*.vim'
IGNORE_FILES[${#IGNORE_FILES[@]}]='artifacts'
IGNORE_FILES[${#IGNORE_FILES[@]}]='docs'
IGNORE_FILES[${#IGNORE_FILES[@]}]='build.sh'
IGNORE_FILES[${#IGNORE_FILES[@]}]='*.txt'
IGNORE_FILES[${#IGNORE_FILES[@]}]='*.md'
manifest="./manifest.json"
function getExtensionName() {
extensionName=`jq .name "$manifest"`
echo ${extensionName//\"}
}
function getVersion() {
version=`jq .version "$manifest"`
echo ${version//\"}
}
function echoExtensionVersion() {
extensionName=`getExtensionName`
version=`getVersion`
echo "Building '$extensionName' version: $version"
}
# Build for Firefox:
echo "----- Building for Firefox -----"
artifactsDir="artifacts/firefox"
echoExtensionVersion
web-ext build --source-dir . --artifacts-dir "${artifactsDir}" --overwrite-dest --ignore-files "${IGNORE_FILES[@]}"
echo "----- Built for Firefox -----"
echo