Skip to content

Commit

Permalink
fix(conf): forbid TS_FILES go to parent dir
Browse files Browse the repository at this point in the history
commit_hash:00bb5c9796cc72f4cce9de385fccbba84758891d
  • Loading branch information
zaverden committed Feb 20, 2025
1 parent 17bcc92 commit 50854e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/plugins/nots.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,14 @@ def on_set_ts_test_for_vars(unit: NotsUnitType, for_mod: str) -> None:

@_with_report_configure_error
def on_ts_files(unit: NotsUnitType, *files: str) -> None:
for f in files:
if f.startswith(".."):
ymake.report_configure_error(
"Macro TS_FILES() does not allow to get files from parent directory.\n"
f"Got path '{f}'.\n"
"Docs: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_PACKAGE#ts-files."
)

new_cmds = ['$COPY_CMD ${{context=TEXT;input:"{0}"}} ${{noauto;output:"{0}"}}'.format(f) for f in files]
all_cmds = unit.get("_TS_FILES_COPY_CMD")
if all_cmds:
Expand Down

0 comments on commit 50854e6

Please sign in to comment.