-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproject
executable file
·76 lines (56 loc) · 1.69 KB
/
project
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
#!/bin/bash
COUNT=0
version() {
case $1 in
nodesource ) echo `node -e 'console.log(require("./package.json").engines.nodesource)'`
;;
* ) echo `node -e 'console.log(require("./package.json").version)'`
;;
esac
}
image() {
VERSION=`project version`
if [[ -f "builds/$1-v$VERSION-$2.xz" ]]; then
echo "$1-$VERSION-$2 up to date"
else
if [[ $COUNT -gt 0 ]] ; then
echo "" >> build.log
fi
echo "$1 - $2 - $(date)" >> build.log
echo "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" >> build.log
make $1-version-$2.img.xz.sha256
echo "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" >> build.log
COUNT=$((COUNT+1))
fi
}
build() {
touch build.log
truncate -s 0 build.log
case $1 in
box ) image "hoobs-box" "arm64"
;;
card ) image "hoobs" "arm64"
;;
legacy ) image "hoobs" "armhf"
;;
* ) image "hoobs-box" "arm64"
image "hoobs" "arm64"
image "hoobs" "armhf"
;;
esac
}
rebuild() {
make clean
build
}
case $1 in
version ) version $2
;;
build ) build $2
;;
rebuild ) rebuild
;;
clean ) make clean
;;
* ) ;;
esac