For context, I want to set a specific parameter ba...
# nf-test
s
For context, I want to set a specific parameter based on execution environment (local vs gh actions) due to some slightly exotic behaviour but the outputs will be identical
n
My impression is that
when
is not used very much and I heard rumours it might leave the language at some point, so I cannot help with that part. But, could you solve your problem using closures?
Copy code
params {
    your_param = { Sys.getenv(SOMEVAR) == "some value" ? "param_value1" : "param_value2"}
}
?
s
ooooh that's a good idea
Nope doesn't seem to work, unless I'm doing it wrong
Copy code
raise_server = { System.getenv("CI") == "true" ? false : true}
just gives
Copy code
"raise_server":{}
regardless of the state of the env var
😕 1
inside the nf-test params.json I mean
n
not sure if really needs the
{ }
around
i think it actually is not a closure, but simply an ordinary if-else, but I think I somehow picked up the habit of just putting things inside
{}
...
🙌 1
s
Ah thanks, that does work!