-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·68 lines (54 loc) · 1.52 KB
/
install.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
shopt -s globstar
# --------------------------------------------------------
# DEFINE LOCAL VARIABLES
# ========================================================
NORMAL=$(tput sgr0)
GREEN=$(tput setaf 2; tput bold)
YELLOW='\033[1;33m'
RED=$(tput setaf 1; tput bold)
NC='\033[0m' # No Color
# --------------------------------------------------------
# COMMON FUNCTIONS
# ========================================================
command_exists () {
type "$1" &> /dev/null ;
}
command_not_exists () {
! type "$1" &> /dev/null ;
}
function red() {
echo -e "$RED$*$NORMAL"
}
function green() {
echo -e "$GREEN$*$NORMAL"
}
function yellow() {
echo -e "$YELLOW$*$NORMAL"
}
function message() {
printf "%0.s$1-" {1..80}.; printf "\n"
echo $2
printf "%0.s=" {1..80}; printf "\n"
printf "${NC}"
}
# --------------------------------------------------------
# BEGIN INSTALLATION OF DEPENDENCIES
# ========================================================
if [ ! -f .install ]; then
message $YELLOW "Let's check npm and npx are installed"
# install pre commit hooks
mkdir -p .git/hooks
cp .git-hooks/* .git/hooks/
echo `date` >> .install
else
message $GREEN "Your system Linux dependencies have been installed already"
fi
# update ctags for the project
if command_exists ctags ; then
ctags -e -R apps/ libs/ ui/**/js/**/*.js templates TAGS
fi
# final message
type cowsay &> /dev/null && cowsay "Let's go installing npm dependencies!" ||
message $GREEN "Let's go installing npm dependencies!"
printf "\n"