-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-dev.sh
executable file
·34 lines (34 loc) · 974 Bytes
/
setup-dev.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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/scripts/setup.sh
if [ $? -ne 0 ]; then
ERROR='\033[0;31m'
DEFAULT='\033[0m'
echo -e "${ERROR}Error: Sourcing setup script${DEFAULT}"
exit 1
fi
success "Sourced setup script"
if [ ! -f ".SETUP" ]; then
npm install -g uglify-js
if [ $? -ne 0 ]; then
error "Could not install uglify-js"
fi
success "Installed uglify-js"
cp $DIR/scripts/setup.sh $DIR/.git/hooks
if [ $? -ne 0 ]; then
error "Could not copy setup script into hooks"
fi
success "Copied setup script into hooks"
cp $DIR/hooks/* $DIR/.git/hooks
if [ $? -ne 0 ]; then
error "Could not copy hook script(s) into git hooks"
fi
success "Copied hook script(s) into git hooks"
touch .SETUP
if [ $? -ne 0 ]; then
error "Could not create setup file"
fi
success "Created setup file"
else
success "Setup hook(s) already exist"
fi;