Add function for checking truthfulness of value

This commit is contained in:
Manuel Thalmann 2023-04-01 15:02:32 +02:00
parent dec2742902
commit 989a51b2e0

View file

@ -12,7 +12,16 @@ then
exit;
fi;
function is_truthy() {
local value;
value="$1";
[ ! -z "$value" ] ||
[ "$value" != "0" ] ||
[ "$value" != "false" ] ||
[ "$value" != "n" ] ||
[ "$value" != "no" ];
}
function handle_status() {
if [ $1 -ne 0 ]; then
@ -216,7 +225,7 @@ then
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|Error\): [A-Z0-9]\+: .*\)$");
if [ ! -z "${USE_WINDOWS_PATHS}" ]
if is_truthy "${USE_WINDOWS_PATHS}"
then
echo "Help me! I am forced to use windows paths, omgg!";
fixCommand="wslpath -m";