-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.command
More file actions
executable file
·47 lines (40 loc) · 990 Bytes
/
build.command
File metadata and controls
executable file
·47 lines (40 loc) · 990 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
42
43
44
45
46
47
#!/bin/bash
# Change for current directory
cd "$(dirname "$0")"
clear
# Check if Gulp is installed and prompt for installation otherwise
if ! gulp -v > /dev/null 2>&1; then
# Check if NPM is installed
if ! npm -v > /dev/null 2>&1; then
echo "NPM is not installed, you should install it first."
exit
fi
echo "Gulp is not installed."
read -p "Do you want to install it (Y/N)? "
if [ "$(echo $REPLY | tr [:upper:] [:lower:])" == "y" ]; then
echo ""
echo "It may take a while to install all dependencies."
npm install gulp -g
$0
exit
else
exit
fi
fi
if [ ! -d "node_modules" ]; then
echo "The dependencies needed to build the project are not installed."
read -p "Do you want to install them (Y/N)? "
if [ "$(echo $REPLY | tr [:upper:] [:lower:])" == "y" ]; then
echo ""
echo "It may take a while to install all dependencies."
npm install
$0
exit
else
exit
fi
fi
# Finally launch the build
gulp build
echo ""
read -n1 -r -p "Press any key to exit"