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