Skip to content

Commit

Permalink
zap/generate.py: Add clarity wrt prefix_chip_root_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
q-thla committed Jan 24, 2023
1 parent e08d644 commit bd9e1cb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/tools/zap/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,21 @@ def getDirPath(name):
def detectZclFile(zapFile):
print(f"Searching for zcl file from {zapFile}")

prefix_chip_root_dir = True
path = 'src/app/zap-templates/zcl/zcl.json'

data = json.load(open(zapFile))
prefix_chip_root_dir = True
for package in data["package"]:
if package["type"] != "zcl-properties":
continue

prefix_chip_root_dir = True
prefix_chip_root_dir = (package["pathRelativity"] != "resolveEnvVars")
# found the right path, try to figure out the actual path
if package["pathRelativity"] == "relativeToZap":
path = os.path.abspath(os.path.join(
os.path.dirname(zapFile), package["path"]))
elif package["pathRelativity"] == "resolveEnvVars":
path = os.path.expandvars(package["path"])
prefix_chip_root_dir = False
else:
path = package["path"]

Expand Down

0 comments on commit bd9e1cb

Please sign in to comment.