File tree Expand file tree Collapse file tree 9 files changed +81
-8
lines changed
Expand file tree Collapse file tree 9 files changed +81
-8
lines changed Original file line number Diff line number Diff line change 1- 3.10.4
1+ 3.10.7
Original file line number Diff line number Diff line change @@ -10,6 +10,39 @@ cd "${BASE_DIR}/.." || exit 127
1010# shellcheck source=../scripts/utils.sh
1111. scripts/utils.sh
1212
13+ PROGRAM=$( basename " ${BASH_SOURCE[0]:- $0 } " )
14+ VERSION=0.7.0
15+
16+ function display_help() {
17+ cat << EOF
18+ $( help_title_section Usage)
19+ ${PROGRAM} [options]
20+
21+ $( help_title_section Options)
22+ -h --help Show this screen.
23+ -v --version Show version.
24+ EOF
25+ }
26+
27+ while [ ! $# -eq 0 ]; do
28+ case " $1 " in
29+ -h | --help)
30+ display_help
31+ exit 0
32+ ;;
33+ -v | --version)
34+ display_version " ${VERSION} " " ${PROGRAM} "
35+ exit 0
36+ ;;
37+ * )
38+ display_help >&2
39+ exit 1
40+ ;;
41+ esac
42+
43+ shift
44+ done
45+
1346source .venv/bin/activate
1447
1548python3 -m bot
Original file line number Diff line number Diff line change @@ -10,6 +10,39 @@ cd "${BASE_DIR}/.." || exit 127
1010# shellcheck source=../scripts/utils.sh
1111. scripts/utils.sh
1212
13+ PROGRAM=$( basename " ${BASH_SOURCE[0]:- $0 } " )
14+ VERSION=0.7.0
15+
16+ function display_help() {
17+ cat << EOF
18+ $( help_title_section Usage)
19+ ${PROGRAM} [options]
20+
21+ $( help_title_section Options)
22+ -h --help Show this screen.
23+ -v --version Show version.
24+ EOF
25+ }
26+
27+ while [ ! $# -eq 0 ]; do
28+ case " $1 " in
29+ -h | --help)
30+ display_help
31+ exit 0
32+ ;;
33+ -v | --version)
34+ display_version " ${VERSION} " " ${PROGRAM} "
35+ exit 0
36+ ;;
37+ * )
38+ display_help >&2
39+ exit 1
40+ ;;
41+ esac
42+
43+ shift
44+ done
45+
1346if not_installed " asdf" ; then
1447 echo_warning "
1548 We are using asdf (https://github.com/asdf-vm/asdf) to manage tool
2861log_info " setup" " Setting up the env file..."
2962if [ ! -f .env ]; then
3063 cp .env.sample .env
31- log_done " env file created, you might want to open .env and set the correct values..."
64+ log_success " env file created, you might want to open .env and set the correct values..."
3265 echo
3366else
3467 log_warn " .env file already exists, skipping..."
Original file line number Diff line number Diff line change 1+ #! /bin/sh -n
2+
13RED=$( tput setaf 1)
24ORANGE=$( tput setaf 3)
35GREEN=$( tput setaf 2)
Original file line number Diff line number Diff line change @@ -133,4 +133,4 @@ function execute() {
133133 return $exitCode
134134}
135135
136- [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.5.6 || true
136+ [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.7.0 || true
Original file line number Diff line number Diff line change @@ -129,4 +129,4 @@ function format() {
129129 fi
130130}
131131
132- [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.5.6 || true
132+ [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.7.0 || true
Original file line number Diff line number Diff line change @@ -31,4 +31,4 @@ function help_title_section() {
3131 echo -e " ${BOLD}${TITLE}${RESET} "
3232}
3333
34- [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.5.6 || true
34+ [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.7.0 || true
Original file line number Diff line number Diff line change @@ -52,4 +52,4 @@ function log_info() {
5252 __log " ${LABEL} " " $CYAN " " $@ "
5353}
5454
55- [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.5.6 || true
55+ [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.7.0 || true
Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ function not_installed() {
1919function load_env_file() {
2020 local file=" ${1:- .env} "
2121 if [ -f " $file " ]; then
22- log_info " Environment" " Loading ${BLUE}${file}${RESET} ..." $( cat " ${file} " )
22+ log_info " Environment" " Loading ${BLUE}${file}${RESET} ..." " $( cat " ${file} " ) "
2323 set -o allexport
24+ # shellcheck source=/dev/null
2425 source " $file "
2526 set +o allexport
2627 else
@@ -52,4 +53,8 @@ function ensure_confirmation() {
5253 fi
5354}
5455
55- [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.5.6 || true
56+ function get_os_name() {
57+ uname | tr ' [:upper:]' ' [:lower:]'
58+ }
59+
60+ [ " $0 " = " ${BASH_SOURCE[0]} " ] && display_version 0.7.0 || true
You can’t perform that action at this time.
0 commit comments