Modified some conditional expressions (with DeMorgan's Law) to fix synta... #48

Merged
merged 1 commit into from Mar 12, 2013

Projects

None yet

2 participants

@feltnerm

I'm on Arch Linux running zsh 5.0.2 (x86_64). On sourcing antigen I encountered a strange error:

-antigen-parse-args:44: bad pattern: [[ -antigen-parse-args:44: = not found -antigen-parse-args:44: bad pattern: [[ -antigen-parse-args:44: = not found fatal: repository '' does not exist -antigen-ensure-repo:48: bad pattern: [[ -antigen-ensure-repo:48: = not found
I looked at the source and found two lines

288:
if ! [[ -z $old_rev || $old_rev == $new_rev ]]; then
and

544:
while ! [[ -z $1 || $1 == --* ]]; do
which were the source of the error. Specifically the '!' in front of the conditional. Not sure if it's my zsh or what...
Simply applying DeMorgan's Law to the expression (removing the '!' in the front by NOTing the entire thing) enabled me to use antigen fully.

Do you think this is just a problem on my end? Any ideas on what it could be? (I don't see any related issues)

Thanks for taking the time to read this.
Regards,

@sharat87 sharat87 merged commit b7d2d3e into zsh-users:master Mar 12, 2013

1 check passed

Details default The Travis build passed
@sharat87
Member

I'm not really sure what's causing the error, but the only difference I see is the zsh version. My system (and on travis), zsh is v4.3.17. I'm not sure though.

As for your fix, I think it actually reads better, without the ! in the front. And your changes to the antigen-revert function do more than fix your problem. You fixed another bug that I just noticed. I forgot to put a return after the echo to stderr :). With your change that is no longer necessary.

Merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment