Fixed remove the file

This commit is contained in:
Dimitris Zlatanidis 2023-03-06 11:15:42 +02:00
parent a0d8dcf7ca
commit 0c920cb131

View file

@ -48,7 +48,12 @@ class UpdateRepository(Configs, Utilities):
subprocess.call(f'lftp {self.lftp_mirror_options} {self.ponce_repo_url} {self.ponce_repo_path}',
shell=True)
# Generating the SLACKBUILDS.TXT file.
# Remove the file before generating the new one.
sbo_file_txt = Path(self.ponce_repo_path, self.ponce_txt)
if sbo_file_txt.is_file():
sbo_file_txt.unlink()
# Generating the ponce SLACKBUILDS.TXT file.
print(f'Generating the {self.ponce_txt} file... ', end='', flush=True)
os.chdir(self.ponce_repo_path)
subprocess.call(f'./gen_sbo_txt.sh > {self.ponce_txt}', shell=True)