just icon indicating copy to clipboard operation
just copied to clipboard

Recipe parameters for variables?

Open bukowa opened this issue 1 year ago • 3 comments

Can it be done?

[unix]
export VAR=1

[windows]
export VAR=2

bukowa avatar Jun 29 '24 23:06 bukowa

So you're seeking to export different values for a particular environment variable depending whether running on Windows or a Unix OS?

Does this do what you're looking for? -

export VAR := if os_family() == 'windows' { "2" } else { "1" }

laniakea64 avatar Jun 30 '24 01:06 laniakea64

So you're seeking to export different values for a particular environment variable depending whether running on Windows or a Unix OS?

Does this do what you're looking for? -

export VAR := if os_family() == 'windows' { "2" } else { "1" }

Yes, thank you. I was hoping for a (e.g. undocumented) more expressive expression like in my example.

bukowa avatar Jun 30 '24 01:06 bukowa

I'm not opposed to allowing OS attributes on variables, so I'll leave this open.

casey avatar Jun 30 '24 19:06 casey