Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
"drvPath": "g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv",
"output": "bar"
},
"outputs": [
"*"
]
"outputs": "*"
}
4 changes: 1 addition & 3 deletions src/libstore-tests/data/outputs-spec/all.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
"*"
]
"*"
4 changes: 1 addition & 3 deletions src/libstore-tests/data/outputs-spec/extended/all.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
"*"
]
"*"
9 changes: 5 additions & 4 deletions src/libstore/outputs-spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,19 @@ using namespace nix;

OutputsSpec adl_serializer<OutputsSpec>::from_json(const json & json)
{
auto names = json.get<StringSet>();
if (names == StringSet({"*"}))
if (json.is_string() && json.get<std::string>() == "*")
return OutputsSpec::All{};
else
else {
auto names = json.get<StringSet>();
return OutputsSpec::Names{std::move(names)};
}
}

void adl_serializer<OutputsSpec>::to_json(json & json, const OutputsSpec & t)
{
std::visit(
overloaded{
[&](const OutputsSpec::All &) { json = std::vector<std::string>({"*"}); },
[&](const OutputsSpec::All &) { json = "*"; },
[&](const OutputsSpec::Names & names) { json = names; },
},
t.raw);
Expand Down
Loading