mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 12:15:34 +03:00
lib.fileset.toSource: Mention fromSource in errors
This commit is contained in:
parent
73493584a7
commit
e07e80e841
4 changed files with 19 additions and 3 deletions
|
@ -153,7 +153,12 @@ If a directory does not recursively contain any file, it is omitted from the sto
|
|||
sourceFilter = _toSourceFilter fileset;
|
||||
in
|
||||
if ! isPath root then
|
||||
if isStringLike root then
|
||||
if root ? _isLibCleanSourceWith then
|
||||
throw ''
|
||||
lib.fileset.toSource: `root` is a `lib.sources`-based value, but it should be a path instead.
|
||||
To use a `lib.sources`-based value, convert it to a file set using `lib.fileset.fromSource` and pass it as `fileset`.
|
||||
Note that this only works for sources created from paths.''
|
||||
else if isStringLike root then
|
||||
throw ''
|
||||
lib.fileset.toSource: `root` ("${toString root}") is a string-like value, but it should be a path instead.
|
||||
Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue