forked from lix-project/lix
Set default installable
Thus $ nix build -f foo.nix will build foo.nix. And $ nix build will build default.nix. However, this may not be a good idea because it's kind of inconsistent, given that "nix build foo" will build the "foo" attribute from the default installation source (i.e. the synthesis of $NIX_PATH), rather than ./default.nix. So I may revert this.
This commit is contained in:
parent
0b6220fbd6
commit
d48c973ece
|
@ -181,6 +181,12 @@ std::vector<std::shared_ptr<Installable>> InstallablesCommand::parseInstallables
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<Installable>> result;
|
std::vector<std::shared_ptr<Installable>> result;
|
||||||
|
|
||||||
|
if (installables.empty()) {
|
||||||
|
if (file == "")
|
||||||
|
file = ".";
|
||||||
|
installables = Strings{""};
|
||||||
|
}
|
||||||
|
|
||||||
for (auto & installable : installables) {
|
for (auto & installable : installables) {
|
||||||
|
|
||||||
if (installable.find("/") != std::string::npos) {
|
if (installable.find("/") != std::string::npos) {
|
||||||
|
@ -198,7 +204,7 @@ std::vector<std::shared_ptr<Installable>> InstallablesCommand::parseInstallables
|
||||||
else if (installable.compare(0, 1, "(") == 0)
|
else if (installable.compare(0, 1, "(") == 0)
|
||||||
result.push_back(std::make_shared<InstallableExpr>(*this, installable));
|
result.push_back(std::make_shared<InstallableExpr>(*this, installable));
|
||||||
|
|
||||||
else if (std::regex_match(installable, attrPathRegex))
|
else if (installable == "" || std::regex_match(installable, attrPathRegex))
|
||||||
result.push_back(std::make_shared<InstallableAttrPath>(*this, installable));
|
result.push_back(std::make_shared<InstallableAttrPath>(*this, installable));
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue