mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle existing images when installing theme
This commit is contained in:
parent
20ff8a1de6
commit
2ad3c5176e
@ -99,6 +99,10 @@ def compile_icon_dir_as_themes(
|
|||||||
return
|
return
|
||||||
dest_name = dest_name.replace('-for-light-theme', '')
|
dest_name = dest_name.replace('-for-light-theme', '')
|
||||||
dest = theme_dir, 'images', (rp + dest_name)
|
dest = theme_dir, 'images', (rp + dest_name)
|
||||||
|
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))
|
os.link(image_path, os.path.join(tdir, *dest))
|
||||||
file('/'.join(dest))
|
file('/'.join(dest))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user