-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yaml Fudgefile #59
Comments
While I have no objection to using YAML, there's a slight hitch in that PowerShell has no direct YAML support. We could use the YamlDotNet library if we go ahead. |
Linky for topic http://dbadailystuff.com/a-brief-introduction-to-yaml-in-powershell I guess that means you think Fudge should be dependency free? As I understand it, vendoring in Powershell is incredibly easy. There is PSYaml and powershell-yaml , which could be added to nuget.org and choco , so they can be explicit dependencies in the Fudge nuspec . And there is https://www.nuget.org/packages/PowerYaml/ , which is https://github.com/scottmuc/PowerYaml , and fork https://github.com/cdhunt/PowerYaml , also looking rather moribund, but sounds like what you mean by YamlDotNet. |
Interesting discussion , and topical comment at PowerShell/PowerShell#3607 (comment) |
Aye, I've seen the issue, and I hope they add in support for PS7. I have no issue having dependencies, but for this using the dll directly is likely easier. Also, since this could be marked for a 2.0 release if we remove json altogether, I'm considering making Fudge a proper module and moving it to PowerShell Gallery (away from choco). This way dependencies would be easier, and I could make this work on nix as well. 🤔 |
From #42: Perhaps better has |
Excuse my limited experience with powershell syntax; if I recall correctly, hashtables (and PS typically) can not have trailing commas . c.f. PowerShell/PowerShell#8873 This makes it undesirable as a descriptive format (use for state changes; config; etc) in the modern era of DVCS, as minor additions and removals require changes of surrounding lines, breaking 'blame' unnecessarily (or people resort to the ugly comma-first trick).
But as alternatives to YAML: XML , TOML, HCL and INI are the common place formats which come to mind. Lots of others are interesting. https://news.ycombinator.com/item?id=18023105 The other one not usually included is Lua - a code as config language that is actually truly sandboxable, with trailing comma support. |
Functions and Arrays can't have them, but that's about it off the top of my head. Hashtables are effectively just JSON, but you can more easily embed scripts into them - and there are no commas or semi-colons: @{
Scripts = @{
Pre = @{
Install = { ./script.ps1 }
}
}
Packages = @(
@{
Name = 'curl'
Version = 'latest'
}
)
} So this would make |
ok, looks good. |
Cue debate ...
The text was updated successfully, but these errors were encountered: