aboutsummaryrefslogtreecommitdiff
path: root/src/nix/develop.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/develop.cc')
-rw-r--r--src/nix/develop.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index 3443fab73..ee782c4ec 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -256,6 +256,9 @@ struct Common : InstallableCommand, MixProfile
// FIXME: properly unquote 'outputs'.
StringMap rewrites;
for (auto & outputName : tokenizeString<std::vector<std::string>>(replaceStrings(outputs->second.quoted, "'", ""))) {
+ // Hacky way to obtain the key of an associate array. This is needed for strctured attrs where
+ // `outputs` is an associative array. If the regex isn't matched, the non-structured-attrs behavior will
+ // be used.
std::regex ptrn(R"re(\[([A-z0-9]+)\]=.*)re");
std::smatch match;
if (std::regex_match(outputName, match, ptrn)) {