V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m15s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m15s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -32,6 +32,9 @@ ensure_lowercase() {
|
||||
ref="${ref,,}"
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f ensure_lowercase
|
||||
|
||||
#######################################
|
||||
# Converts the value of a passed variable to uppercase.
|
||||
@@ -53,6 +56,9 @@ ensure_uppercase() {
|
||||
ref="${ref^^}"
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f ensure_uppercase
|
||||
|
||||
#######################################
|
||||
# Removes leading and trailing spaces in the value.
|
||||
@@ -75,6 +81,9 @@ ensure_trimmed() {
|
||||
ref="${ref%"${ref##*[![:space:]]}"}"
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f ensure_trimmed
|
||||
|
||||
#######################################
|
||||
# Resets the value of the variable to a default value if it is empty or contains only whitespace.
|
||||
@@ -102,6 +111,9 @@ reset_to_default() {
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f reset_to_default
|
||||
|
||||
#######################################
|
||||
# Checks whether the content of a variable matches a specific regex.
|
||||
@@ -129,4 +141,7 @@ assert_match() {
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f assert_match
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user