Skip to content

Commit

Permalink
fix for _meta.json (#35023)
Browse files Browse the repository at this point in the history
  • Loading branch information
msyyc authored Apr 1, 2024
1 parent 00ff2b8 commit efad456
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/azure-sdk-tools/packaging_tools/generate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,19 @@ def update_servicemetadata(sdk_folder, data, config, folder_name, package_name,
if not package_folder.exists():
_LOGGER.info(f"Fail to save metadata since package folder doesn't exist: {package_folder}")
return
for_swagger_gen = "meta" in config
metadata_folder = package_folder / "_meta.json"
if metadata_folder.exists() and for_swagger_gen:
with open(metadata_folder, "r") as file_in:
metadata = json.load(file_in)
else:
metadata = {}

metadata = {
metadata.update({
"commit": data["headSha"],
"repository_url": data["repoHttpsUrl"],
}
if "meta" in config:
})
if for_swagger_gen:
readme_file = str(Path(spec_folder, input_readme))
global_conf = config["meta"]
local_conf = config.get("projects", {}).get(readme_file, {})
Expand Down

0 comments on commit efad456

Please # to comment.