From 58e3608e258d35e1a8b132cd65a20d2200f01b9f Mon Sep 17 00:00:00 2001 From: edef Date: Tue, 4 Aug 2020 08:50:10 +0000 Subject: [PATCH] feat(nix/readTree): allow arguments to depend on tree location This accepts a function for args, and passes it an attrset containing the locatedAt parameter. Change-Id: I3c0f8ca00605e02a787fda88f32b06f5ef9998f2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1639 Tested-by: BuildkiteCI Reviewed-by: tazjin --- nix/readTree/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 4faf20d9e..9793310ee 100644 --- a/nix/readTree/default.nix +++ b/nix/readTree/default.nix @@ -17,9 +17,9 @@ let readDir substring; - argsWithPath = parts: args // { - locatedAt = parts; - }; + argsWithPath = parts: + let meta.locatedAt = parts; + in meta // (if isAttrs args then args else args meta); readDirVisible = path: let