Commit graph

18 commits

Author SHA1 Message Date
Robert Hensing 8fa169707f
Merge pull request #242695 from tweag/lib.path.subpath.components
`lib.path.subpath.components`: init
2023-08-04 17:00:46 +02:00
Silvan Mosberger 4e14f5fee6 lib.path.subpath.components: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-26 23:29:44 +02:00
Silvan Mosberger b42e178ed4 lib.path.splitRoot: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-26 23:20:12 +02:00
Robert Hensing 814f067760
Merge pull request #238013 from tweag/lib.path.removePrefix
`lib.path.removePrefix`: init
2023-07-19 17:28:05 +02:00
Robert Hensing 0665253b86
Merge pull request #244044 from tweag/lib-readme
Create a Readme in `lib`
2023-07-19 16:34:36 +02:00
Silvan Mosberger 581d7c88be lib/tests: Unify documentation of individual testable files 2023-07-18 17:22:45 +02:00
Silvan Mosberger 6626d8cc4d lib.path.removePrefix: init 2023-07-10 21:25:43 +02:00
Robert Hensing e17f4dae6f lib/path/tests/prop.sh: Add --show-trace 2023-06-26 12:25:36 +02:00
Robert Hensing 050e7e29aa lib/path/tests: Add --show-trace
This should help troubleshoot errors.
Fyi --eval is just a flag, not an option with a value.
2023-06-26 12:12:34 +02:00
Silvan Mosberger 592213ad3f lib.path.hasPrefix: init 2023-06-15 22:29:46 +02:00
Silvan Mosberger 1a2c2846b0 lib.path.subpath.join: init
This function can be used to safely join subpaths together
2023-02-13 14:01:17 +01:00
Silvan Mosberger a770c0393c
Merge pull request #208887 from tweag/lib.path.append
lib.path.append: init
2023-02-07 17:27:37 +01:00
Silvan Mosberger eac2538707 lib.path.append: init
This function can be used to append strings to Nix path values in a
safe way.
2023-01-18 20:17:31 +01:00
Silvan Mosberger 5c4f616198 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-01-18 18:19:17 +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