-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
executable file
·41 lines (37 loc) · 873 Bytes
/
Copy pathbuild
File metadata and controls
executable file
·41 lines (37 loc) · 873 Bytes
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
## Clean our directory
buildFiles=(graph.min.js graph.min.js.map .jsver)
for f in buildFiles
do
if [ -a $f ]; then
rm $f
fi
done
## Read in Files
function replaceBuild {
echo "${1/\[BUILD\]/$2}"
}
function replaceVersion {
echo "${1/\[VERSION\]/$2}"
}
## Read in Version and Build Number
version=`cat .version`
if [ -a ".build-counter" ]; then
build=`cat .build-counter` ## Read Last BuildNumber
build=`expr $build + 1`
else
build=1
fi
## Write our BuildNumber back
echo $build > '.build-counter'
preamble=`cat PREAMBLE`
preamble="${preamble}"
preamble=$(replaceVersion "$preamble" "$version")
preamble=$(replaceBuild "$preamble" "$build")
## Get all Source files
for f in src/*.js
do
files="$files $f"
done
## Run UglifyJS2
uglifyjs $files -o graph.min.js --source-map graph.min.js.map --preamble "$preamble" --mangle --compress --lint