Automatically search parent directories for the ipkg
This commit is contained in:
parent
1f4b8b3c03
commit
dd1579607a
2 changed files with 21 additions and 12 deletions
|
@ -33,12 +33,14 @@ class Test {
|
|||
say $_.out.trim.lines.map(*.indent($indent-level + 2))
|
||||
.join("\n");
|
||||
}
|
||||
if $_.err.trim {
|
||||
say colored('stderr:', 'underline')
|
||||
.indent($indent-level + 2);
|
||||
say $_.err.trim.lines.map(*.indent($indent-level + 2))
|
||||
.join("\n");
|
||||
}
|
||||
# say $_.err.elems;
|
||||
# if $_.err.trim {
|
||||
# say $_.err.trim.lines.elems;
|
||||
# say colored('stderr:', 'underline')
|
||||
# .indent($indent-level + 2);
|
||||
# say $_.err.trim.lines.map(*.indent($indent-level + 2))
|
||||
# .join("\n");
|
||||
# }
|
||||
return True;
|
||||
}
|
||||
}
|
||||
|
@ -143,5 +145,10 @@ sub scan-ipkg(IO::Path:D $ipkg --> PackageInfo:D) {
|
|||
sub scan-packages(--> Array[PackageInfo:D]) is export {
|
||||
my PackageInfo:D @ipkgs =
|
||||
paths(:file(*.ends-with(".ipkg"))).map(*.IO.&scan-ipkg);
|
||||
return @ipkgs;
|
||||
# Check out the parents if we didn't find an ipkg
|
||||
if @ipkgs {
|
||||
return @ipkgs;
|
||||
} else {
|
||||
indir $*CWD.parent, {scan-packages};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue