-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuhd.sh
executable file
·73 lines (59 loc) · 2.08 KB
/
uhd.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
69
70
71
72
73
#!/bin/bash
root=$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)
for script_file in "$root"/scripts/_*.sh; do
source $script_file
done
function _uhd_commands_help() {
echo
echo " █░█ █▄▀ █░█ █▀ ▄▀█ "
echo " █▄█ █░█ █▀█ ▄█ █▀█ "
echo
echo " █▀▄ ▄▀█ ▀█▀ ▄▀█ █▀▄ ▄▀█ █▀ █░█ █▄▄ █▀█ ▄▀█ █▀█ █▀▄ "
echo " █▄▀ █▀█ ░█░ █▀█ █▄▀ █▀█ ▄█ █▀█ █▄█ █▄█ █▀█ █▀▄ █▄▀ "
echo
echo " █▀▀ █░░ █"
echo " █▄▄ █▄▄ █"
echo
echo " UKHSA Data Dashboard Backend CLI Tool"
echo
echo "uhd <command> [options]"
echo
echo "commands:"
echo " help - this help screen"
echo
echo " bootstrap - bootstrap environment commands"
echo " cache - cache flush tooling commands"
echo " django - django application commands"
echo " security - security tooling commands"
echo " server - running server commands"
echo " tests - test suite execution commands"
echo " quality - code quality tooling commands"
echo " venv - virtual environment commands"
return 0
}
function uhd() {
local current=$(pwd)
local command=$1
local args=(${@:2})
cd $root
case $command in
"bootstrap") _bootstrap "${args[@]}" ;;
"cache") _cache $args ;;
"django") _django $args ;;
"security") _security $args ;;
"server") _server $args ;;
"tests") _tests $args ;;
"quality") _quality $args ;;
"venv") _venv $args ;;
*) _uhd_commands_help ;;
esac
local exit_code=$?
cd $current
return $exit_code
}
echo
echo "uhd cli loaded"
echo
echo "Type uhd for the help screen"
echo
return 0