mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 20:13:56 -06:00
Fix deleting old files if they exist
Rmdir crashes when it needs to delete just one file, annoyingly. Contributes to issue CURA-9409.
This commit is contained in:
parent
970e0d8395
commit
254edfd3ec
1 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,7 @@ def build_appimage():
|
||||||
copy_metadata_files()
|
copy_metadata_files()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(os.path.join(dist_path, appimage_filename)) # Ensure any old file is removed, if it exists.
|
os.remove(os.path.join(dist_path, appimage_filename)) # Ensure any old file is removed, if it exists.
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
pass # If it didn't exist, that's even better.
|
pass # If it didn't exist, that's even better.
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ def copy_metadata_files():
|
||||||
|
|
||||||
packaging_dir = os.path.dirname(__file__)
|
packaging_dir = os.path.dirname(__file__)
|
||||||
for source, dest in copied_files.items():
|
for source, dest in copied_files.items():
|
||||||
|
print("Copying", os.path.join(packaging_dir, source), "to", os.path.join(dist_path, dest))
|
||||||
shutil.copyfile(os.path.join(packaging_dir, source), os.path.join(dist_path, dest))
|
shutil.copyfile(os.path.join(packaging_dir, source), os.path.join(dist_path, dest))
|
||||||
|
|
||||||
# Ensure that AppRun has the proper permissions: 755 (user reads, writes and executes, group reads and executes, world reads and executes).
|
# Ensure that AppRun has the proper permissions: 755 (user reads, writes and executes, group reads and executes, world reads and executes).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue