resort findImport
This commit is contained in:
parent
8725f5079f
commit
f42dcdd49a
1 changed files with 9 additions and 6 deletions
|
|
@ -4,10 +4,13 @@
|
||||||
pathExists
|
pathExists
|
||||||
;
|
;
|
||||||
in {
|
in {
|
||||||
findImport = path:
|
findImport = path: let
|
||||||
if pathExists path
|
pathA = path + "/default.nix";
|
||||||
then path
|
pathB = path + ".nix";
|
||||||
else if pathExists (path + "default.nix")
|
in
|
||||||
then path + "/default.nix"
|
if pathExists pathA
|
||||||
else path + ".nix";
|
then pathA
|
||||||
|
else if pathExists pathB
|
||||||
|
then pathB
|
||||||
|
else path;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue