summaryrefslogtreecommitdiffstats
path: root/bash-lib.sh
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-11-09 13:49:51 +0100
committerMinijackson <minijackson@riseup.net>2021-11-09 13:49:51 +0100
commit87321860b4497aadd02bfe7fd43ebe59318d371d (patch)
treead33699d47680a58c9f3ba279395a2ce5ec930f1 /bash-lib.sh
parent5831374267589a88c0bb1c3e2799207c75b2b25c (diff)
downloadbash-lib-87321860b4497aadd02bfe7fd43ebe59318d371d.tar.gz
bash-lib-87321860b4497aadd02bfe7fd43ebe59318d371d.zip
make shellcheck pass + make demo.sh executable
Diffstat (limited to 'bash-lib.sh')
-rw-r--r--bash-lib.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/bash-lib.sh b/bash-lib.sh
index b2bb3df..58fbd7a 100644
--- a/bash-lib.sh
+++ b/bash-lib.sh
@@ -11,23 +11,32 @@ tput() {
11} 11}
12 12
13NORMAL="$(tput sgr0)" 13NORMAL="$(tput sgr0)"
14# shellcheck disable=SC2034
14readonly NORMAL 15readonly NORMAL
15BOLD="$(tput bold)" 16BOLD="$(tput bold)"
17# shellcheck disable=SC2034
16readonly BOLD 18readonly BOLD
17 19
18RED="$(tput setaf 1)" 20RED="$(tput setaf 1)"
21# shellcheck disable=SC2034
19readonly RED 22readonly RED
20GREEN="$(tput setaf 2)" 23GREEN="$(tput setaf 2)"
24# shellcheck disable=SC2034
21readonly GREEN 25readonly GREEN
22YELLOW="$(tput setaf 3)" 26YELLOW="$(tput setaf 3)"
27# shellcheck disable=SC2034
23readonly YELLOW 28readonly YELLOW
24BLUE="$(tput setaf 4)" 29BLUE="$(tput setaf 4)"
30# shellcheck disable=SC2034
25readonly BLUE 31readonly BLUE
26PURPLE="$(tput setaf 5)" 32PURPLE="$(tput setaf 5)"
33# shellcheck disable=SC2034
27readonly PURPLE 34readonly PURPLE
28CYAN="$(tput setaf 6)" 35CYAN="$(tput setaf 6)"
36# shellcheck disable=SC2034
29readonly CYAN 37readonly CYAN
30WHITE="$(tput setaf 7)" 38WHITE="$(tput setaf 7)"
39# shellcheck disable=SC2034
31readonly WHITE 40readonly WHITE
32 41
33readonly BASH_LIB_LOG_VAR="${BASH_LIB_NAME:-BASH}_LOG" 42readonly BASH_LIB_LOG_VAR="${BASH_LIB_NAME:-BASH}_LOG"
@@ -46,6 +55,7 @@ if is_debug; then
46else 55else
47 VERBOSE_ARG=() 56 VERBOSE_ARG=()
48fi 57fi
58# shellcheck disable=SC2034
49readonly VERBOSE_ARG 59readonly VERBOSE_ARG
50 60
51echoe() { 61echoe() {
@@ -57,7 +67,7 @@ log() {
57 local color="$2" 67 local color="$2"
58 local message="$3" 68 local message="$3"
59 shift 3 69 shift 3
60 local rest="$@" 70 local -a rest=("$@")
61 71
62 echoe "${BOLD}${color}${level} ${WHITE}${message}${NORMAL}" "${rest[@]}" 72 echoe "${BOLD}${color}${level} ${WHITE}${message}${NORMAL}" "${rest[@]}"
63} 73}