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:
Greg Magolan 2022-06-03 00:39:35 -07:00 committed by GitHub
parent 9162a3f552
commit 128f7c63fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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(