Skip to content

Commit

Permalink
fix: add codes
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn committed Oct 14, 2024
1 parent 5d4afe2 commit c5f48cf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build/ten_runtime/feature/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def write_published_results_to_file(
file.write(published_results)


def update_manifest(base_dir: str, os_str: str, cpu_str: str) -> None:
def update_manifest(
base_dir: str, os_str: str, cpu_str: str, log_level: int
) -> None:
manifest_path = os.path.join(base_dir, "manifest.json")

os_arch_pair = f"{os_str}:{cpu_str}"
Expand All @@ -65,7 +67,10 @@ def update_manifest(base_dir: str, os_str: str, cpu_str: str) -> None:
],
check=True,
)
print(f"Manifest updated successfully with os/cpu: {os_str}/{cpu_str}")
if log_level > 0:
print(
f"Manifest updated successfully with os/cpu: {os_str}/{cpu_str}"
)
except subprocess.CalledProcessError as e:
print(f"Failed to update manifest.json: {e}")
sys.exit(1)
Expand Down Expand Up @@ -107,7 +112,7 @@ def update_manifest(base_dir: str, os_str: str, cpu_str: str) -> None:
if args.enable_publish is False:
sys.exit(0)

update_manifest(args.base_dir, args.os, args.cpu)
update_manifest(args.base_dir, args.os, args.cpu, args.log_level)

# Use 'tman publish' to perform the uploading.
origin_wd = os.getcwd()
Expand Down

0 comments on commit c5f48cf

Please sign in to comment.