Closed ronlut closed 4 years ago
Are you sure that your test.sh
has correct shebang? Can you please try the same with: A=1 zsh ./test.sh
?
Because my test works correctly:
~
» if (( A )); then
echo "A"
fi
~
» export A=1
~
» if (( A )); then
echo "A"
fi
A
I just want to say that I started checking this behavior as I tried to stop tracking by running export WAKATIME_DO_NOT_TRACK=true
, which didn't stop without my proposed fix.
Few things:
.sh
file. I guess that means bash was used even though zsh is my default shellA=1
indeed worksA=true
, A="true"
, A="something"
doesn't workI guess the options are either to use a different condition in the if as I proposed or change the documentation that states:
$WAKATIME_DO_NOT_TRACK: you can also disable tracking for some period of time by setting environment variable to any non-empty value, defaults to false
Yes, let's better change the docs to be "set WAKATIME_DO_NOT_TRACK=1
"
Did that. I still think it might be confusing but let's see how it goes 🙂
Thanks a lot!
Hi. Sure - this feature didn't work at all for me. I'm not very familiar with zsh syntax TBH, so I'm not sure about the original syntax (
(( VAR ))
) to check if a variable is set. I tried the original syntax in a simple test script and it doesn't work:test.sh
While this works:
test_working.sh
That's why I switched to the new syntax. Try it and let me know what you think, maybe I'm missing something :)