diff --git a/ts2panda/scripts/generate_plugin.py b/ts2panda/scripts/generate_plugin.py index 0f7fe8e3dd59a070e541b11aa56b2f4d77466ccf..e90aafd23b7eb495a653fa2a49736f39abe37c4a 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: