-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·52 lines (38 loc) · 1.61 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
#!/bin/sh
set -e
PLATFORM=$(uname | tr '[A-Z]' '[a-z]')
ARCH=$(getconf LONG_BIT)
BASE="$(cd "$(dirname "$_")"; pwd)"
NODE_DIR="$BASE/tools/node/$PLATFORM-x$ARCH"
NODE="$NODE_DIR/bin/node"
printf '=============================================================\n'
printf 'Validating node installation...\n'
printf '=============================================================\n'
if [ -e "$NODE_DIR" ]; then
# If a standalone node installation exists, use that
chmod 770 "$NODE"
printf 'Standalone node installation found!\n'
printf 'Location: %s\n' "$NODE"
printf '=============================================================\n'
printf 'Installing dependencies...\n'
printf '=============================================================\n'
"$NODE_DIR/bin/npm" install
"$NODE" "$NODE_DIR/bin/bower" install
printf '=============================================================\n'
printf 'Performing Grunt build...\n'
printf '=============================================================\n'
"$NODE" "$NODE_DIR/bin/grunt" $@
else
# Otherwise, assume global install is available
printf 'Global node installation found!\n'
printf '=============================================================\n'
printf 'Installing dependencies...\n'
printf '=============================================================\n'
npm install
bower install
printf '=============================================================\n'
printf 'Performing Grunt build...\n'
printf '=============================================================\n'
grunt $@
fi
printf 'DONE'