From 944837a05398cdb6fb12ffdd718df1607a4648ea Mon Sep 17 00:00:00 2001 From: Nima Fanniasl <76901932+nimafanniasl@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:04:18 +0330 Subject: [PATCH] Update fetch-macOS-v2.py --- fetch-macOS-v2.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fetch-macOS-v2.py b/fetch-macOS-v2.py index 250a63f5e..af58e3748 100755 --- a/fetch-macOS-v2.py +++ b/fetch-macOS-v2.py @@ -221,6 +221,11 @@ def save_image(url, sess, filename='', directory=''): if filename.find('/') >= 0 or filename == '': raise RuntimeError('Invalid save path ' + filename) + path = os.path.join(directory, filename) + if os.path.isfile(path): + print(f"File {filename} already exists, Skipping...") + return os.path.join(directory, os.path.basename(filename)) + print(f'Saving {url} to {directory}/{filename}...') with open(os.path.join(directory, filename), 'wb') as fh: