From e1568e0d03649682ab5b375aa056b399e0b798f7 Mon Sep 17 00:00:00 2001 From: SamulKyull Date: Mon, 16 Dec 2024 00:53:54 +0800 Subject: [PATCH] [build] support auto gen config for json --- tools/gen_vscode_json.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/gen_vscode_json.py b/tools/gen_vscode_json.py index 60951ef8..457c3721 100644 --- a/tools/gen_vscode_json.py +++ b/tools/gen_vscode_json.py @@ -38,10 +38,11 @@ def generate_c_cpp_properties(config): # Write the generated c_cpp_properties.json content to a file def write_c_cpp_properties_json(output_file_path, cpp_properties): - with open(output_file_path, "w") as json_file: - json.dump( - cpp_properties, json_file, indent=4 - ) # Write formatted JSON to the file + try: + with open(output_file_path, "w") as json_file: + json.dump(cpp_properties, json_file, indent=4) + except FileNotFoundError: + pass # Main function to execute the process