Skip to content

Commit

Permalink
lib/string: make isStorePath total (#26216)
Browse files Browse the repository at this point in the history
fix #9278
  • Loading branch information
Profpatsch authored and zimbatm committed May 29, 2017
1 parent 4e88e82 commit 2b0a842
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,13 @@ rec {
=> true
isStorePath pkgs.python
=> true
isStorePath [] || isStorePath 42 || isStorePath {} || …
=> false
*/
isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir;
isStorePath = x:
builtins.isString x
&& builtins.substring 0 1 (toString x) == "/"
&& dirOf (builtins.toPath x) == builtins.storeDir;

/* Convert string to int
Obviously, it is a bit hacky to use fromJSON that way.
Expand Down

0 comments on commit 2b0a842

Please sign in to comment.