Open premun opened 3 years ago
I think generating something like this would work:
steps:
- powershell: |
dotnet tool install `
Microsoft.DotNet.XHarness.CLI `
--global `
--add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json `
--version "1.0.0-prerelease*" `
I think this approach is powershell specific, but doing something similar for bash can work as well found this https://yaml-multiline.info/ which is really helpful for me to understand this,
we could introduce a new type that will implement IYamlConvertible
and force the scalar value to be a multiline string (using the enum values ScalarStyle.Literal
and ScalarStyle.Folded
)
Motivation
Many times you want to include a very long shell call as a script that should fit into 1 line, e.g.:
However, you need to escape the EOLs or you need to concatenate it as a long C# string which then makes it harder to read in the YAML.
Goal
Make some API that would tell YAML to use the notation where it concatenates lines of an array it receives via the
>
sign and allow user to supply an array of strings.Or some other pleasant way of dealing with this use case.