From ec0ff62bcbd89111c1eabaf48d80e427679b1f5c Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Sun, 5 Jan 2025 15:32:32 +0100 Subject: [PATCH] fix translator --- scripts/translator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/translator.py b/scripts/translator.py index bab66acc4..5d1264c26 100644 --- a/scripts/translator.py +++ b/scripts/translator.py @@ -232,8 +232,11 @@ def copy_files(source_path, dest_path): for file_name in file_names: source_filepath = os.path.join(source_path, file_name) dest_filepath = os.path.join(dest_path, file_name) - shutil.copy2(source_filepath, dest_filepath) - print(f"[+] Copied {file_name}") + if not os.path.exists(source_filepath): + print(f"Error: {source_filepath} does not exist.") + else: + shutil.copy2(source_filepath, dest_filepath) + print(f"[+] Copied {file_name}") def translate_file(language, file_path, file_dest_path, model, client): global VERBOSE