Skip to content

Commit 20e824b

Browse files
thesayynalexeagle
authored andcommitted
fix: set declaration dir to "." when its empty
ts_project fails when it is placed at workspace root with `declaration=True` due to empty declaration dir argument.
1 parent 194af26 commit 20e824b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ts/private/ts_project.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ def _ts_project_impl(ctx):
6060
_lib.calculate_root_dir(ctx),
6161
])
6262
if len(typings_outs) > 0:
63-
declaration_dir = ctx.attr.declaration_dir if ctx.attr.declaration_dir else ctx.attr.out_dir
63+
declaration_dir = _lib.join(ctx.label.package, ctx.attr.declaration_dir) if ctx.attr.declaration_dir else ctx.label.package
64+
if declaration_dir == "":
65+
declaration_dir = "."
6466
arguments.add_all([
6567
"--declarationDir",
66-
_lib.join(ctx.label.package, ctx.attr.declaration_dir) if ctx.attr.declaration_dir else ctx.label.package,
68+
declaration_dir,
6769
])
6870

6971
# When users report problems, we can ask them to re-build with

0 commit comments

Comments
 (0)