Merge pull request #64421 from rycee/bugfix/writeTextDir-with-slash

trivial-builders: support '/' in writeTextDir
This commit is contained in:
Danylo Hlynskyi 2019-07-16 21:11:50 +03:00 committed by GitHub
commit 70d6271e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,17 +94,21 @@ rec {
/*
* Writes a text file to nix store in a specific directory with no
* optional parameters available. Name passed is the destination.
* optional parameters available.
*
* Example:
* # Writes contents of file to /nix/store/<store path>/<name>
* # Writes contents of file to /nix/store/<store path>/share/my-file
* writeTextDir "share/my-file"
* ''
* Contents of File
* '';
*
*/
writeTextDir = name: text: writeTextFile {inherit name text; destination = "/${name}";};
writeTextDir = path: text: writeTextFile {
inherit text;
name = builtins.baseNameOf path;
destination = "/${path}";
};
/*
* Writes a text file to /nix/store/<store path> and marks the file as