Skip to content

Commit c314049

Browse files
committed
Merge branch 'master' into dp/add-bokken-connection
2 parents 0031332 + 2a0d318 commit c314049

File tree

9 files changed

+81
-8
lines changed

9 files changed

+81
-8
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.4
1+
3.10.7

bin/server

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
1346
source .venv/bin/activate
1447

1548
python3 -m bot

bin/setup

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
1346
if not_installed "asdf"; then
1447
echo_warning "
1548
We are using asdf (https://github.com/asdf-vm/asdf) to manage tool
@@ -28,7 +61,7 @@ fi
2861
log_info "setup" "Setting up the env file..."
2962
if [ ! -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
3366
else
3467
log_warn ".env file already exists, skipping..."

scripts/colors.sh

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/sh -n
2+
13
RED=$(tput setaf 1)
24
ORANGE=$(tput setaf 3)
35
GREEN=$(tput setaf 2)

scripts/extras.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

scripts/fmt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

scripts/helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

scripts/logging.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

scripts/utils.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ function not_installed() {
1919
function 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

0 commit comments

Comments
 (0)