Skip to content

Commit

Permalink
use declare and not define in error message and mention also local
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Oct 18, 2024
1 parent 9e189bd commit b985b1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utility/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function exitIfVariablesNotDeclared() {
shift 1 || traceAndDie "could not shift by 1"
for variableName in "$@"; do
if ! declare -p "$variableName" 2>/dev/null | grep -q 'declare --'; then
logError "you need to define the variable \033[0;36m%s\033[0m otherwise we write to the global scope" "$variableName"
logError "you need to \`declare\` (\`local\`) the variable \033[0;36m%s\033[0m otherwise we write to the global scope (you can also \`declare\` it in the global scope)" "$variableName"
printStackTrace
exit 1
fi
Expand Down

0 comments on commit b985b1a

Please sign in to comment.