lib.isStorePath: fix false result when passed a path object
Since `isStorePath` relies on comparing against builtins.storeDir (a string), we need to convert the input into a string as well.
This commit is contained in:
+6
-3
@@ -502,9 +502,12 @@ rec {
|
||||
=> false
|
||||
*/
|
||||
isStorePath = x:
|
||||
isCoercibleToString x
|
||||
&& builtins.substring 0 1 (toString x) == "/"
|
||||
&& dirOf x == builtins.storeDir;
|
||||
if isCoercibleToString x then
|
||||
let str = toString x; in
|
||||
builtins.substring 0 1 str == "/"
|
||||
&& dirOf str == builtins.storeDir
|
||||
else
|
||||
false;
|
||||
|
||||
/* Convert string to int
|
||||
Obviously, it is a bit hacky to use fromJSON that way.
|
||||
|
||||
Reference in New Issue
Block a user