tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lib: add fileContents function
Eric Sagnes
9 years ago
56575cc0
0804f670
+10
1 changed file
expand all
collapse all
unified
split
lib
strings.nix
+10
lib/strings.nix
···
479
479
absolutePaths = builtins.map (path: builtins.toPath (root + "/" + path)) relativePaths;
480
480
in
481
481
absolutePaths;
482
482
+
483
483
+
/* Read the contents of a file removing the trailing \n
484
484
+
485
485
+
Example:
486
486
+
$ echo "1.0" > ./version
487
487
+
488
488
+
fileContents ./version
489
489
+
=> "1.0"
490
490
+
*/
491
491
+
fileContents = file: removeSuffix "\n" (builtins.readFile file);
482
492
}