/
build.sh
executable file
·42 lines (32 loc) · 985 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
42
#!/bin/bash
# Current script pwd
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Remove the config template
rm -rf dist/src/config.js
checklists=(
cleaning-checklist
hotel-checkout-checklist
jira-release-checklist
moving-checklist
stretch-checklist
travel-checklist
)
buildChecklist() {
checklist=$1
cd "$DIR" || exit 1
cp -r "$DIR"/dist/src/. "$DIR"/dist/examples/"${checklist}"
cp "$DIR"/webpack.config.js "$DIR"/dist/examples/"${checklist}"
cp "$DIR"/src/checklist.html "$DIR"/dist/examples/"${checklist}"
cd ${DIR}/dist/examples/${checklist} && ${DIR}/node_modules/webpack-cli/bin/cli.js
cd "$DIR"/dist/examples/"${checklist}" && find *.js | grep -v bundle.js | xargs rm
}
export -f buildChecklist
echo "Total checklists found: ${checklists[@]}"
for checklist in "${checklists[@]}"
do
echo "Building ${checklist}"
buildChecklist "${checklist}"
done;
cd "$DIR" || exit 1
rm -r dist/src
rm -r dist/test