From ed6a5ba3bb560642e06d5c1f0c4d81fce152360a Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Wed, 15 Feb 2023 13:44:20 +0100 Subject: [PATCH] [nrf noup] Update generate.py script to make it work on Windows --- scripts/tools/zap/generate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index bd12075216..47563de61c 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -150,6 +150,10 @@ def extractGeneratedIdl(output_dir, zap_config_path): # multiple extensions. This is to work with existing codebase only raise Error("Unexpected input zap file %s" % self.zap_config) + # If the ".matter" already exists in this location, some OS (e.g. Windows) will not allow to simply overwrite it. + if os.path.exists(target_path): + os.remove(target_path) + os.rename(idl_path, target_path)