1
0

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

View File

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