fix: improve error message when an invalid label or a file that is not a directory is passed to directory_path (#127)
This commit is contained in:
parent
9162a3f552
commit
128f7c63fb
|
@ -14,7 +14,7 @@ DirectoryPathInfo = provider(
|
|||
|
||||
def _directory_path(ctx):
|
||||
if not ctx.file.directory.is_directory:
|
||||
fail("directory attribute must be created with Bazel declare_directory (TreeArtifact)")
|
||||
fail("expected directory to be a TreeArtifact (ctx.actions.declare_directory) but got {}".format(ctx.file.directory))
|
||||
return [DirectoryPathInfo(path = ctx.attr.path, directory = ctx.file.directory)]
|
||||
|
||||
directory_path = rule(
|
||||
|
|
Loading…
Reference in New Issue