-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure
executable file
·71 lines (58 loc) · 1.37 KB
/
configure
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
#!/bin/bash
THIS_DIR = `cd "\`dirname \"$0\"\`";pwd`
echo ${THIS_DIR}
check_package_existance () {
echo "working on package " $1
}
check_version () {
echo " expected version for " $1 " 0.00.01"
}
UserMassageError() {
White='\033[0;37m' # White
IRed='\033[0;91m' # Red
IGreen='\033[0;92m' # Green
IYellow='\033[0;93m' # Yellow
if [ $1 == 'e' ]; then
echo -e "${IRed} [ERROR]: ${White} $2"
elif [ $1 == 'w' ]; then
echo -e "${IYellow} [WORNING]: ${White} $2"
elif [ $1 == 'p']; then
echo -e "${IGreen} [NOTICE]: ${White} $2"
fi
}
CheckFilePathExist() {
UBlack='\033[4;30m' # Black
URed='\033[4;31m' # Red
UGreen='\033[4;32m' # Green
UYellow='\033[4;33m' # Yellow
UBlue='\033[4;34m' # Blue
UPurple='\033[4;35m' # Purple
UCyan='\033[4;36m' # Cyan
UWhite='\033[4;37m' # White
White='\033[0;37m' # White
if [ $1 == 'f' ]; then
if [ -f $2 ]; then
return 0
fi
fi
if [ $1 == 'p' ]; then
if [ -d $2 ]; then
return 0
fi
fi
if [ $1 == 'fw' ]; then
if [ ! -f $2 ]; then
UserMassageError 'e' "File ${UYellow}$2${White} Does NOT exist"
else
return 0
fi
fi
if [ $1 == 'pw' ]; then
if [ ! -d $2 ]; then
UserMassageError 'e' "Path ${UYellow}$2${White} Does NOT exist"
else
return 0
fi
fi
return 1
}