casey / just

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

Allow conditionnal expression to take argument #1974

Open wiiznokes opened 1 month ago

wiiznokes commented 1 month ago

My use case it this:

build target='':
    if {{target}} == "release" { 
        "cargo build --release"
    } else { 
        "cargo build"
    }

I think condition without arguments are mostly useless

laniakea64 commented 1 month ago

Does this achieve your use case? -

build target='':
    {{if target == "release" { \
        "cargo build --release" \
    } else { \
        "cargo build" \
    } }}
wiiznokes commented 1 month ago

Yeah, kind of thanks.