perfectsense / gyro

Gyro is a command-line tool for creating, updating, and maintaining cloud infrastructure. Gyro makes infrastructure-as-code possible.
https://gyro.dev
Apache License 2.0
134 stars 7 forks source link

OR logic not working #361

Closed deepanjan90 closed 3 years ago

deepanjan90 commented 3 years ago

Describe the bug using the or operator in conditional logic such as when using @if fails

To Reproduce gyro up the following

foo: foo
@if $foo = foo
    @print: '$foo = foo'
@end

@if 1
    @print: '1'
@end

@if 1 or $foo = bar
    @print: '1 or $foo = bar'
@end

@if $foo = bar or 1
    @print: '$foo = bar or 1'
@end

Expected behavior Should print

"$foo = foo"

"1"

"1 or $foo = bar"

"$foo = bar or 1"

Current Behavior But prints

"$foo = foo"

"1"