Skip to content

Commit 77a54d5

Browse files
crisbetowagnermaciel
authored andcommitted
build: handle top-level packages in API approval script (#23808)
Fixes that the `approve-api` script was generating the wrong Bazel target for `google-maps` and `youtube-player`. Fixes #23782. (cherry picked from commit 15dbc95)
1 parent 8857023 commit 77a54d5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/approve-api-golden.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ if (!packageNameGuess.result) {
2626
}
2727

2828
const [packageName, ...entryPointTail] = packageNameGuess.result.split('/');
29-
const apiGoldenTargetName = `//tools/public_api_guard:${packageName}/${entryPointTail.join(
30-
'-',
31-
)}.md_api.accept`;
29+
const suffix = entryPointTail.length ? entryPointTail.join('-') : packageName;
30+
const apiGoldenTargetName = `//tools/public_api_guard:${packageName}/${suffix}.md_api.accept`;
3231

3332
// ShellJS should exit if any command fails.
3433
shelljs.set('-e');

0 commit comments

Comments
 (0)