Silvan Mosberger
37b34c47e0
lib.path.append: init
...
This function can be used to append strings to Nix path values in a
safe way.
2023-02-13 14:55:12 +01:00
Silvan Mosberger
253e3bd231
lib.path: Minor improvements
...
- Use isValid when possible instead of subpathInvalidReason: https://github.com/NixOS/nixpkgs/pull/209099#discussion_r1068714681
- Add documentation to function arguments
- Use newlines for error messages: https://github.com/NixOS/nixpkgs/pull/208887#discussion_r1069737602
- Add short comments for the unit test groups: https://github.com/NixOS/nixpkgs/pull/208887#discussion_r1072913051
- Slight formatting improvement for laws: https://github.com/NixOS/nixpkgs/pull/209099#discussion_r1068707955
2023-02-13 14:55:12 +01:00
Silvan Mosberger
041b044a66
lib/path/tests: Fix property tests when "-n" is generated
...
When "-n" is generated by the property tests, it causes `echo` to not
output the string since it's interpreted as an option. Apparently
there's no good way to print "-n" with `echo` [1], so switching to
`printf` instead
[1]: https://unix.stackexchange.com/questions/85846/how-can-i-print-n-with-echo
2023-01-10 14:18:35 +01:00
Silvan Mosberger
0667ef5dd5
lib.path.subpath.normalise: add property tests
2023-01-03 13:21:06 +01:00
Silvan Mosberger
63dd6d20db
lib.path.subpath.normalise: init
2023-01-03 13:21:03 +01:00
Silvan Mosberger
98fbcf1788
lib.path.subpath.isValid: init
...
The first path library function
2023-01-03 13:20:36 +01:00
Silvan Mosberger
ba7ed22f84
lib.path: init README.md document
...
Adds initial work towards a `lib.path` library
Originally proposed in https://github.com/NixOS/nixpkgs/pull/200718 , but has
since gone through some revisions
Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io >
Co-Authored-By: Robert Hensing <robert@roberthensing.nl >
2023-01-03 13:19:42 +01:00