Rimossi file di destinazione in caso di esistenza.

This commit is contained in:
Emiliano Vavassori 2022-04-08 23:26:50 +02:00
parent b21c06038d
commit f2d0630c15
1 changed files with 4 additions and 0 deletions

View File

@ -337,6 +337,8 @@ class Build(object):
# Create the symlink
print(f"Creating {appimagefilename[arch]} and checksums.")
if os.path.exists(appimagefilename[arch]):
os.unlink(appimagefilename[arch])
os.symlink(self.appimagefilename[arch], appimagefilename[arch])
# Create the checksum for the AppImage
subprocess.run(shlex.split(f"md5sum {appimagefilename[arch]} > {appimagefilename[arch]}.md5"))
@ -345,6 +347,8 @@ class Build(object):
continue
print(f"Creating zsync file for version {version}.")
if os.path.exists(zsyncfilename[arch]):
os.unlink(zsyncfilename[arch])
shutil.copyfile(self.zsyncfilename[arch], zsyncfilename[arch])
# Editing the zsyncfile
subprocess.run(shlex.split(f"sed -i'' -e 's/^Filename:.*$/Filename: {appimagefilename[arch]}/' {zsyncfilename[arch]}"))