mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
build: simplify logic for integration test starlark macro (#43431)
Simplifies the `last_segment_name` computation in the integration test Starlark macro we use. The last segment name could be computed in a shorter way and this has come up while being at it (through review; so this commit addresses that). PR Close #43431
This commit is contained in:
parent
fe2a8de1b5
commit
ce7fabebc2
1 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ def npm_package_archives():
|
|||
"""
|
||||
for name in npm_packages_to_archive:
|
||||
label_name = _npm_package_archive_label(name)
|
||||
last_segment_name = name if name.find("/") == -1 else name.split("/")[-1]
|
||||
last_segment_name = name.split("/")[-1]
|
||||
result += """pkg_tar(
|
||||
name = "{label_name}",
|
||||
srcs = ["//{name}:{last_segment_name}__all_files"],
|
||||
|
|
@ -143,7 +143,7 @@ def _angular_integration_test(name, **kwargs):
|
|||
if pkg in use_view_engine_packages:
|
||||
npm_packages["@npm//:" + _npm_package_archive_label("%s-12" % pkg)] = pkg
|
||||
else:
|
||||
last_segment_name = pkg if pkg.find("/") == -1 else pkg.split("/")[-1]
|
||||
last_segment_name = pkg.split("/")[-1]
|
||||
npm_packages["//packages/%s:npm_package_archive" % last_segment_name] = pkg
|
||||
|
||||
npm_integration_test(
|
||||
|
|
|
|||
Loading…
Reference in a new issue