-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall
More file actions
executable file
·76 lines (59 loc) · 1.41 KB
/
install
File metadata and controls
executable file
·76 lines (59 loc) · 1.41 KB
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
72
73
74
75
76
#!/bin/bash
function main() {
PWD=$(pwd)
SCRIPTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
COMMAND=$1
GPU=0
if [[ "$PWD" != "$SCRIPTDIR" ]]; then
print_error "This script needs to be launched in its own root directory!\nexit"
exit 1
fi
parse_arg "${@:2}"
case $COMMAND in
prerequisite)
./install-prerequisite.sh --gpu=${GPU}
;;
hello-world)
./build-pockets.sh --hello-world --gpu=${GPU}
;;
all-pockets)
./build-pockets.sh --all --gpu=${GPU}
;;
esac
}
function parse_arg() {
for arg in $@; do
case $arg in
--gpu=*)
GPU=${arg#*=}
;;
*)
;;
esac
done
}
_BOLD="\e[1m"
_DIM="\e[2m"
_RED="\e[31m"
_LYELLOW="\e[93m"
_LGREEN="\e[92m"
_LCYAN="\e[96m"
_LMAGENTA="\e[95m"
_RESET="\e[0m"
function print_error() {
local message=$1
echo -e "${_BOLD}${_RED}[ERROR]${_RESET} ${message}${_RESET}"
}
function print_warning() {
local message=$1
echo -e "${_BOLD}${_LYELLOW}[WARN]${_RESET} ${message}${_RESET}"
}
function print_info() {
local message=$1
echo -e "${_BOLD}${_LGREEN}[INFO]${_RESET} ${message}${_RESET}"
}
function print_debug() {
local message=$1
echo -e "${_BOLD}${_LCYAN}[DEBUG]${_RESET} ${message}${_RESET}"
}
main "$@"; exit