Skip to content

Commit

Permalink
added optional ip name
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy committed Aug 4, 2024
1 parent 69b4317 commit 3cbf8f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions ipm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,11 +1218,14 @@ def update_ips(ipm_root, ip_root=None, ip_to_update=None):
else:
logger.print_warn("No IPs in your project to be updated.")

def check_ip(ip_root):
def check_ip(ip_root, ip_name=None):
logger = Logger()

# Step 1: check Yaml file
yaml_info_file = os.path.join(ip_root, f"{os.path.basename(ip_root)}.yaml")
if not ip_name:
yaml_info_file = os.path.join(ip_root, f"{os.path.basename(ip_root)}.yaml")
else:
yaml_info_file = os.path.join(ip_root, f"{ip_name}.yaml")
logger.print_step("[STEP 1]: Check if Yaml file exists")
if os.path.exists(yaml_info_file):
logger.print_success(f"Yaml file exists at {yaml_info_file}")
Expand All @@ -1232,7 +1235,7 @@ def check_ip(ip_root):

# Step 2: Check content of Yaml file
logger.print_step("[STEP 2]: Check content of Yaml file")
checker = Checks(ip_root, os.path.basename(ip_root))
checker = Checks(ip_root, ip_name)
if checker.check_yaml():
logger.print_success("Yaml content check passed")
else:
Expand Down
7 changes: 5 additions & 2 deletions ipm/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ def update_cmd(ipm_root, ip_root, ip):
default=os.getcwd(),
help="IP path",
)
def check_ip_cmd(ip_root):
@click.option(
"--ip-name", required=False, help="IP name"
)
def check_ip_cmd(ip_root, ip_name):
"""Checks IPs for usability with IPM."""
check_ip(ip_root)
check_ip(ip_root, ip_name)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ipmgr"
version = "1.0.8"
version = "1.0.9"
description = "Package manager for Open Source ASIC IPs"
authors = ["Efabless Corporation <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 3cbf8f7

Please sign in to comment.