Replies: 5 comments 1 reply
-
@JanKrivanek , could you help us with this one? |
Beta Was this translation helpful? Give feedback.
-
@dansiegel |
Beta Was this translation helpful? Give feedback.
-
IIRC your scenario should be supported - explicitly passed empty should be respect by coallesce (per #4737 and #5776). If that doesn't work than it sounds as a regression. Gangs workaround feels as an easy way out of this though |
Beta Was this translation helpful? Give feedback.
-
@JanKrivanek unfortunately the solution proposed by @GangWang01 is the way we've gone but is less than intuitive for end users. Instead of just specifying "" as the list of test options, they have to specify "none" and what if they specify "none,ui" which is possible since it's multi-select. |
Beta Was this translation helpful? Give feedback.
-
@nickrandolph |
Beta Was this translation helpful? Give feedback.
-
I have a template which has 2 quick presets for whether to start from a blank or recommended state. All options then become optional to from the blank state or to disable from the recommended state. Based on this setting I dynamically adjust the default values through a combination of a generated switch default and a generated coalesce value to ensure that when a value has been selected by a user that we respect what the user provided rather than using the preset default.
The problem I am running into is supporting when someone chooses the recommended preset and they do not want any tests. If we do not rely on a dynamic default for example we could set the default to
unit|ui
and then when the template is generated you would simply dodotnet new mytemplate -tests ""
and it will evaluate with no tests. However using the generated default and coalesce value whentests == ""
it will fallback to the preset default. Can someone help provide some recommendations for how I can accomplish the goal while still allowing someone to choose the recommended preset but remove the tests if they want.Beta Was this translation helpful? Give feedback.
All reactions