-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
64 lines (52 loc) · 1.11 KB
/
install.sh
File metadata and controls
64 lines (52 loc) · 1.11 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
#!/usr/bin/env bash
handle_help() {
echo -e "Usage: install.sh [mode] \n"
echo -e "install.sh - Installation Script for the Core Deployment Utility \n"
echo "Positional Arguments:"
echo -e "[mode] {deploy, develop}\tsets the installation mode of the application. \n"
echo "Optional Arguments:"
echo -e "-h, --help\t\t\t Displays this help menu."
echo -e "-v, --version\t\t\t Displays the version"
return $1
}
handle_version() {
echo -e "version 0.1"
return 0
}
handle_deploy() {
pip install . --upgrade
return 0
}
handle_develop() {
pip install -e .
return 0
}
handle_error() {
echo -e "\nUnhandled argument received\n"
handle_help 1
}
for var in "$@"
do
if [ "$var" = "--help" -o "$var" = "-h" ]
then
handle_help 0
exit 0
fi;
if [ "$var" = "--version" -o "$var" = "-v" ]
then
handle_version
exit 0
fi;
if [ "$var" = "deploy" ]
then
handle_deploy
exit 0
fi;
if [ "$var" = "develop" ]
then
handle_develop
exit 0
fi;
handle_error
exit 1
done