Add function for checking truthfulness of value
This commit is contained in:
parent
dec2742902
commit
989a51b2e0
11
compile.sh
11
compile.sh
|
@ -12,7 +12,16 @@ then
|
||||||
exit;
|
exit;
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
function is_truthy() {
|
||||||
|
local value;
|
||||||
|
value="$1";
|
||||||
|
|
||||||
|
[ ! -z "$value" ] ||
|
||||||
|
[ "$value" != "0" ] ||
|
||||||
|
[ "$value" != "false" ] ||
|
||||||
|
[ "$value" != "n" ] ||
|
||||||
|
[ "$value" != "no" ];
|
||||||
|
}
|
||||||
|
|
||||||
function handle_status() {
|
function handle_status() {
|
||||||
if [ $1 -ne 0 ]; then
|
if [ $1 -ne 0 ]; then
|
||||||
|
@ -216,7 +225,7 @@ then
|
||||||
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
|
errorPatterns+=("\(\)\(.*\)\(([[:digit:]]\+): \(warning\|note\|error\): \([A-Z0-9]\+: \)\?.*\)$")
|
||||||
errorPatterns+=("\(\"\)\(.*\)\(\", line [[:digit:]]\+\( (column [[:digit:]]\+)\)\?: \(Warning\|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
|
then
|
||||||
echo "Help me! I am forced to use windows paths, omgg!";
|
echo "Help me! I am forced to use windows paths, omgg!";
|
||||||
fixCommand="wslpath -m";
|
fixCommand="wslpath -m";
|
||||||
|
|
Loading…
Reference in a new issue