diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2021-06-22 20:37:25 +0200 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2021-06-22 21:14:20 +0200 |
commit | 6f206549ba02c6f9bdbf9707bba9193a1d82e822 (patch) | |
tree | f46e941dae74236c0303eef9fcd386e06dff4e17 /src/libstore/parsed-derivations.cc | |
parent | 27ce722638eeabb987bc9b4a1234c2818c5bf401 (diff) |
Move `writeStructuredAttrsShell` out of `ParsedDerivation` class
Diffstat (limited to 'src/libstore/parsed-derivations.cc')
-rw-r--r-- | src/libstore/parsed-derivations.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc index 5675600c4..f021e4de3 100644 --- a/src/libstore/parsed-derivations.cc +++ b/src/libstore/parsed-derivations.cc @@ -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()) |