lib.path.hasPrefix: init

This commit is contained in:
Silvan Mosberger
2023-04-05 20:31:50 +02:00
parent 866f75e5b9
commit 592213ad3f
3 changed files with 83 additions and 2 deletions

View File

@@ -264,7 +264,8 @@ rec {
lib.strings.hasPrefix: The first argument (${toString pref}) is a path value, but only strings are supported.
There is almost certainly a bug in the calling code, since this function always returns `false` in such a case.
This function also copies the path to the Nix store, which may not be what you want.
This behavior is deprecated and will throw an error in the future.''
This behavior is deprecated and will throw an error in the future.
You might want to use `lib.path.hasPrefix` instead, which correctly supports paths.''
(substring 0 (stringLength pref) str == pref);
/* Determine whether a string has given suffix.