writeOut: add support for text checking
This commit is contained in:
parent
51fcdfac0a
commit
d59facd88c
|
@ -91,6 +91,7 @@ rec {
|
||||||
|
|
||||||
writers.text =
|
writers.text =
|
||||||
{ path
|
{ path
|
||||||
|
, check ? null
|
||||||
, executable ? false
|
, executable ? false
|
||||||
, mode ? if executable then "0755" else "0644"
|
, mode ? if executable then "0755" else "0644"
|
||||||
, text
|
, text
|
||||||
|
@ -102,6 +103,9 @@ rec {
|
||||||
var = "file_${hashString "sha1" path}";
|
var = "file_${hashString "sha1" path}";
|
||||||
val = text;
|
val = text;
|
||||||
install = /* sh */ ''
|
install = /* sh */ ''
|
||||||
|
${optionalString (check != null) /* sh */ ''
|
||||||
|
${check} ''$${var}Path
|
||||||
|
''}
|
||||||
${pkgs.coreutils}/bin/install -m ${mode} -D ''$${var}Path $out${path}
|
${pkgs.coreutils}/bin/install -m ${mode} -D ''$${var}Path $out${path}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user