casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
17.59k stars 399 forks source link

Omitting "else" from an if statement #2002

Open alshdavid opened 1 month ago

alshdavid commented 1 month ago

Hi all,

Please close this issue if this is already possible - it doesn't seem to work currently

When using an if statement, an else block must be present

foo myarg:
  echo {{ if myarg != "" { "myarg is present" } else { "" } }}

Would it be possible to default to "" is an else block is omitted?

foo myarg:
  echo {{ if myarg != "" { "myarg is present" } }}

Thanks!