handle inline entry case

This commit is contained in:
jacekpoz 2024-09-13 15:42:57 +02:00
parent fac9a1ef95
commit 5f85e5c218
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -2,6 +2,7 @@ pkgs: src: {extraArgs, entries, templates}: let
inherit (pkgs) lib;
inherit (builtins) dirOf;
inherit (lib.attrsets) isAttrs;
inherit (lib.lists) forEach;
inherit (lib.strings) concatMapStrings escapeShellArg;
@ -17,11 +18,11 @@ pkgs: src: {extraArgs, entries, templates}: let
getEntry = getEntry args' templates src;
};
processEntryFile = entryFile: let
foundTemplateFn = findTemplateFn templates entry.template;
entry = getEntry args templates src entryFile;
processEntryFile = entry: let
entry' = if isAttrs entry then entry else getEntry args templates src entry;
foundTemplateFn = findTemplateFn templates entry'.template;
in
applyTemplate args templates foundTemplateFn entry;
applyTemplate args templates foundTemplateFn entry';
in /*sh*/''
${concatMapStrings