forked from PenguiniVogel/BuffUtility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
96 lines (73 loc) · 2.04 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# tsc
echo "Running bundled tsc -p tsconfig.build.json"
node_modules/.bin/tsc -p tsconfig.build.json
echo " "
# tsc
echo "Running bundled tsc -p background/tsconfig.build.json"
node_modules/.bin/tsc -p background/tsconfig.build.json
echo " "
# tsc
echo "Running bundled tsc -p options/tsconfig.build.json"
node_modules/.bin/tsc -p options/tsconfig.build.json
echo " "
# tsc
echo "Running bundled tsc -p steam/tsconfig.build.json"
node_modules/.bin/tsc -p steam/tsconfig.build.json
echo " "
# delete previous export
echo "Deleting previous export..."
rm -rf ".export"
echo " "
# pause
read -p "Press [ENTER] to resume ..."
# setup folder structure
echo "Checking directory structure..."
mkdir -p .export/{BuffUtility,BuffUtility_Firefox}/sources/{adjustments,csgostash}
mkdir -p .export/{BuffUtility,BuffUtility_Firefox}/resources/{css,icon}
mkdir -p .export/{BuffUtility,BuffUtility_Firefox}/{background,options,steam}
echo " "
# f_copy
f_copy() {
for f in $1
do
echo "Processing (cp) $f -> $2/${f:$3}"
cp "$f" "$2/${f:$3}"
done
}
# f_build
f_build() {
# copy sources/*.js
f_copy ".out/sources/*.js" "$DEST" 5
# copy sources/**/*.js
f_copy ".out/sources/**/*.js" "$DEST" 5
# copy steam/*.js
f_copy ".out/steam/*.js" "$DEST" 5
# copy background/merge_background.js
f_copy ".out/background/merge_background.js" "$DEST" 5
# copy options/merge_options.js
f_copy ".out/options/merge_options.js" "$DEST" 5
# copy options/options.html
f_copy "options/options.html" "$DEST" 0
# copy resources css
f_copy "resources/css/*.css" "$DEST/resources/css" 14
# copy resources icon
f_copy "resources/icon/*.png" "$DEST/resources/icon" 15
# rewrite manifest
echo "Writing manifest.json -> $DEST/manifest.json"
node ./resources/rewrite-manifest.js "$1"
echo " "
}
# regular build
DEST=".export/BuffUtility"
# f_build regular
echo "f_build (normal)"
f_build ""
echo " "
# firefox build
DEST=".export/BuffUtility_Firefox"
# f_build firefox
echo "f_build (Firefox)"
f_build "firefox"
echo " "
# pause
read -p "Press [ENTER] to resume ..."