mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 19:29:36 +01:00
Move writeStructuredAttrsShell out of ParsedDerivation class
This commit is contained in:
parent
27ce722638
commit
6f206549ba
5 changed files with 13 additions and 9 deletions
|
|
@ -165,13 +165,13 @@ std::optional<nlohmann::json> ParsedDerivation::prepareStructuredAttrs(std::opti
|
|||
return json;
|
||||
}
|
||||
|
||||
std::string ParsedDerivation::writeStructuredAttrsShell(nlohmann::json & json)
|
||||
/* As a convenience to bash scripts, write a shell file that
|
||||
maps all attributes that are representable in bash -
|
||||
namely, strings, integers, nulls, Booleans, and arrays and
|
||||
objects consisting entirely of those values. (So nested
|
||||
arrays or objects are not supported.) */
|
||||
std::string writeStructuredAttrsShell(nlohmann::json & json)
|
||||
{
|
||||
/* As a convenience to bash scripts, write a shell file that
|
||||
maps all attributes that are representable in bash -
|
||||
namely, strings, integers, nulls, Booleans, and arrays and
|
||||
objects consisting entirely of those values. (So nested
|
||||
arrays or objects are not supported.) */
|
||||
|
||||
auto handleSimpleType = [](const nlohmann::json & value) -> std::optional<std::string> {
|
||||
if (value.is_string())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue