This commit is contained in:
Eelco Dolstra 2019-09-20 16:06:49 +02:00
parent 5a0e98d1e5
commit 14d3f45009

View file

@ -425,29 +425,15 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
getDefaultFlakeAttrPathPrefixes())); getDefaultFlakeAttrPathPrefixes()));
else { else {
std::exception_ptr flakeEx;
try { try {
auto flakeRef = FlakeRef(s, true); auto flakeRef = FlakeRef(s, true);
result.push_back(std::make_shared<InstallableFlake>( result.push_back(std::make_shared<InstallableFlake>(
*this, std::move(flakeRef), getDefaultFlakeAttrPaths())); *this, std::move(flakeRef), getDefaultFlakeAttrPaths()));
continue; } catch (...) {
} catch (MissingFlake &) {
/* 's' could be parsed as a flakeref, but it
references a local path that is not a flake. So
take note of that. */
flakeEx = std::current_exception();
} catch (BadFlakeRef &) {
}
if (s.find('/') != std::string::npos && (storePath = follow(s))) if (s.find('/') != std::string::npos && (storePath = follow(s)))
result.push_back(std::make_shared<InstallableStorePath>(*storePath)); result.push_back(std::make_shared<InstallableStorePath>(*storePath));
else {
if (flakeEx)
std::rethrow_exception(flakeEx);
else else
throw Error("unsupported argument '%s'", s); throw;
} }
} }
} }