Add function for checking truthfulness of value
This commit is contained in:
parent
dec2742902
commit
989a51b2e0
1 changed files with 10 additions and 1 deletions
11
compile.sh
11
compile.sh
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue