mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-04-09 10:34:00 +00:00
Use hasPrefix
This commit is contained in:
parent
7bed4edc21
commit
c0dbe755a4
1 changed files with 3 additions and 3 deletions
6
lib.nix
6
lib.nix
|
@ -168,15 +168,15 @@ let
|
|||
type = flake-parts-lib.mkPerSystemType module;
|
||||
};
|
||||
|
||||
# Returns the inputs of another input that matches `outPath`, or by default
|
||||
# the root inputs if the `outPath` is not an input.
|
||||
# Returns the inputs of another input that includes `outPath`, or by default
|
||||
# the root inputs if the `outPath` does not belong to an input.
|
||||
findInputsByOutPath = outPath: inputs:
|
||||
let
|
||||
findInputByOutPath = outPath:
|
||||
lib.attrsets.concatMapAttrs
|
||||
(inputName: input:
|
||||
(
|
||||
if input.outPath == toString outPath then
|
||||
if lib.strings.hasPrefix input.outPath (toString outPath) then
|
||||
input
|
||||
else
|
||||
findInputByOutPath outPath input.inputs or { }
|
||||
|
|
Loading…
Add table
Reference in a new issue