vars: use writeShellApplication to shellcheck generators
This commit is contained in:
@@ -16,7 +16,7 @@ let
|
||||
;
|
||||
|
||||
promptToFile = name: ''
|
||||
cat "$prompts/${name}" > "$out/${name}"
|
||||
cat "$prompts"/${name} > "$out"/${name}
|
||||
'';
|
||||
|
||||
promptsToFilesScript = concatMapStrings promptToFile;
|
||||
@@ -25,8 +25,13 @@ let
|
||||
in
|
||||
{
|
||||
finalScript = mkOptionDefault (
|
||||
pkgs.writeScript "generator-${config.name}" ''
|
||||
set -eu -o pipefail
|
||||
lib.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "generator-${config.name}";
|
||||
text = ''
|
||||
in="''${in:?}"
|
||||
out="''${out:?}"
|
||||
${if config.prompts == { } then "" else ''prompts="''${prompts:?}"''}
|
||||
|
||||
export PATH="${makeBinPath config.runtimeInputs}:${pkgs.coreutils}/bin"
|
||||
|
||||
@@ -53,7 +58,9 @@ in
|
||||
''}
|
||||
${promptsToFilesScript filePromptNames}
|
||||
${config.script}
|
||||
''
|
||||
'';
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
files = genAttrs filePromptNames (_name: { });
|
||||
|
||||
Reference in New Issue
Block a user