From f5e217630023810577cb0b84571c4c1df4f2c2a3 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Wed, 11 May 2022 11:38:09 +0800 Subject: [PATCH] fix incre compile of ts2abc Signed-off-by: zhangrengao Change-Id: Ie20580ac3e91401fd6a0ba54be62e48c60eee012 --- ts2panda/scripts/generate_plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts2panda/scripts/generate_plugin.py b/ts2panda/scripts/generate_plugin.py index 0f7fe8e3dd..e90aafd23b 100755 --- a/ts2panda/scripts/generate_plugin.py +++ b/ts2panda/scripts/generate_plugin.py @@ -88,12 +88,15 @@ def gen_java_method(input_arguments): file_path = input_arguments.plugin_path out_file = input_arguments.generated_file + if os.path.exists(out_file): + os.remove(out_file) + file_name_pre = os.path.splitext(file_name)[0] js_src_file = os.path.join(file_path, file_name) (out_dir, _) = os.path.split(input_arguments.generated_file) js_bin_file = os.path.join(out_dir, file_name_pre + JS_BIN_EXT) - flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL + flags = os.O_WRONLY | os.O_CREAT modes = stat.S_IWUSR | stat.S_IRUSR with os.fdopen(os.open(out_file, flags, modes), "w") as output: -- Gitee