From 67320a16689b84361777f3a03c8dcc5b72a339dc Mon Sep 17 00:00:00 2001 From: Pasquale Date: Sun, 28 Nov 2021 19:33:22 +0100 Subject: [PATCH] concatText: fix typos --- pkgs/build-support/trivial-builders.nix | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index ee5a492cdc1..b02afb37943 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -332,14 +332,12 @@ rec { * name = "my-file"; * files = [ drv1 "${drv2}/path/to/file" ]; * } - * # See also the `concatdText` helper function below. + * # See also the `concatText` helper function below. * * # Writes executable my-file to /nix/store//bin/my-file * concatTextFile { * name = "my-file"; - * files = '' - * Contents of File - * ''; + * files = [ drv1 "${drv2}/path/to/file" ]; * executable = true; * destination = "/bin/my-file"; * } @@ -355,14 +353,12 @@ rec { runCommandLocal name { inherit files executable checkPhase meta destination; } '' - n=$out$destination - mkdir -p "$(dirname "$n")" - cat $files > "$n" - touch "$n" + file=$out$destination + mkdir -p "$(dirname "$file")" + cat $files > "$file" + (test -n "$executable" && chmod +x "$file") || true eval "$checkPhase" - - (test -n "$executable" && chmod +x "$n") || true ''; @@ -381,7 +377,7 @@ rec { * * Example: * # Writes contents of files to /nix/store/ - * concatdScript "my-file" [ file1 file2 ] + * concatScript "my-file" [ file1 file2 ] * */ concatScript = name: files: concatTextFile { inherit name files; executable=true; };