From 4b0a1716240120cc4d77bb5740bbac311d849535 Mon Sep 17 00:00:00 2001 From: vofy Date: Sun, 30 Mar 2025 17:32:02 +0200 Subject: [PATCH] Modify 3mf generation script --- scripts/generate_3mf_files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/generate_3mf_files.py b/scripts/generate_3mf_files.py index 926edc2..fc87461 100755 --- a/scripts/generate_3mf_files.py +++ b/scripts/generate_3mf_files.py @@ -17,7 +17,10 @@ printed_3mf_dir = os.path.join(project_root, "3mf") # Get the short hash of the current Git commit git_short_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip() -# Create the 3mf directory if it doesn't exist +# Remove the existing 3MF directory if it exists and create a new one +if os.path.exists(printed_3mf_dir): + os.rmdir(printed_3mf_dir) + os.makedirs(printed_3mf_dir, exist_ok=True) # List to keep track of files that failed to export