ignore error of os.unlink

This commit is contained in:
z4yx 2020-03-09 13:32:02 +08:00
parent b08781e47a
commit 08791785e0

View File

@ -166,8 +166,14 @@ def main():
task_queue.put((url, dst_file, working_dir, updated))
if latest:
os.unlink(repo_dir / "LatestRelease")
os.symlink(name, repo_dir / "LatestRelease")
try:
os.unlink(repo_dir / "LatestRelease")
except OSError:
pass
try:
os.symlink(name, repo_dir / "LatestRelease")
except OSError:
pass
for repo in args.repo:
repo_dir = working_dir / Path(repo)