Allow conditional resource manifest args
Summary of the new feature / enhancement
It would be useful to have conditional args passed to resources, like OS or architecture, for example.
Proposed technical implementation details (optional)
Add a new arg object:
{
"condition": "<expression>",
"args": [ <args> ]
}
condition would accept a valid expression and args is only appended if condition evaluates to true. Of course, some functions won't be available.
args would be an array and itself can take any valid arg string or object.
Will condition require the wrapping []?
I wonder whether we might want to provide some variants like os and commandExists - or manifest-only expressions (since they don't need to be ARM compatible). I suppose you could have multiple conditional argument object definitions and it's on the author to ensure the combinations are valid (and handle ensuring mutually exclusive options / preventing unintentional duplicate arguments).
I also wonder about being able to conditionally select not an argument but the executable.
os is now exposed via the context() function so that is covered. We could add a commandExists() function. I don't think we need to specialize these functions to only work within a manifest. We could also allow for executable property to be an expression.