Handle existing images when installing theme

This commit is contained in:
Kovid Goyal 2022-07-15 19:37:39 +05:30
parent 20ff8a1de6
commit 2ad3c5176e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -99,7 +99,11 @@ def compile_icon_dir_as_themes(
return
dest_name = dest_name.replace('-for-light-theme', '')
dest = theme_dir, 'images', (rp + dest_name)
os.link(image_path, os.path.join(tdir, *dest))
try:
os.link(image_path, os.path.join(tdir, *dest))
except FileExistsError:
os.remove(os.path.join(tdir, *dest))
os.link(image_path, os.path.join(tdir, *dest))
file('/'.join(dest))
for dirpath, dirnames, filenames in os.walk(path_to_dir):