Skip to content

Commit fb5c723

Browse files
authored
remove tsp-location.yaml (#36411)
1 parent 7b2584e commit fb5c723

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/azure-sdk-tools/packaging_tools/sdk_generator.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def after_multiapi_combiner(sdk_code_path: str, package_name: str, folder_name:
9191
_LOGGER.info(f"do not find {toml_file}")
9292

9393

94-
def del_outdated_samples(readme: str):
94+
def del_outdated_files(readme: str):
9595
python_readme = Path(readme).parent / "readme.python.md"
9696
if not python_readme.exists():
9797
_LOGGER.info(f"do not find python configuration: {python_readme}")
@@ -102,6 +102,12 @@ def del_outdated_samples(readme: str):
102102
sdk_folder = extract_sdk_folder(content)
103103
is_multiapi = is_multiapi_package(content)
104104
if sdk_folder:
105+
# remove tsp-location.yaml
106+
tsp_location = Path(f"sdk/{sdk_folder}/tsp-location.yaml")
107+
if tsp_location.exists():
108+
os.remove(str(tsp_location))
109+
_LOGGER.info(f"remove tsp-location.yaml: {tsp_location}")
110+
# remove generated_samples
105111
sample_folder = Path(f"sdk/{sdk_folder}/generated_samples")
106112
if sample_folder.exists():
107113
# rdbms is generated from different swagger folder;multiapi package may don't generate every time
@@ -272,7 +278,7 @@ def main(generate_input, generate_output):
272278
if "resource-manager" in input_readme:
273279
relative_path_readme = str(Path(spec_folder, input_readme))
274280
update_metadata_for_multiapi_package(spec_folder, input_readme)
275-
del_outdated_samples(relative_path_readme)
281+
del_outdated_files(relative_path_readme)
276282
config = generate(
277283
CONFIG_FILE,
278284
sdk_folder,

0 commit comments

Comments
 (0)