From 94908047927e196e7c376ae6b60e1f13699e721d Mon Sep 17 00:00:00 2001 From: Kendall Goto Date: Wed, 23 Apr 2025 16:58:18 -0700 Subject: [PATCH] [nrf noup] Use ZAP CLI for version check Both `zap --version` and `zap-cli --version` do the same thing more or less, but `zap` is heavier to run since it starts Electron just to do `--version`. Since the user may only care about `zap-cli` commands (e.g. `west zap-generate`), requiring that all `west zap-*` commands call `zap` just to get a version check increases the amount of resources and dependencies required Signed-off-by: Kendall Goto --- scripts/west/zap_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/west/zap_common.py b/scripts/west/zap_common.py index 9fc3da2d828..cee80fa10e6 100644 --- a/scripts/west/zap_common.py +++ b/scripts/west/zap_common.py @@ -189,13 +189,13 @@ def get_current_version(self) -> Tuple[int, int, int]: """ Returns ZAP package current version as a tuple of integers. - Parses the output of `zap --version` to determine the current ZAP + Parses the output of `zap-cli --version` to determine the current ZAP package version. If the ZAP package has not been installed yet, the method returns None. """ try: output = subprocess.check_output( - [self.get_zap_path(), '--version']).decode('ascii').strip() + [self.get_zap_cli_path(), '--version']).decode('ascii').strip() except Exception: return None