Skip to content

Commit

Permalink
Fix bug where file already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankpatibandla committed Dec 24, 2024
1 parent 5f04f60 commit 8ac9c40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions desktop_icons_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
for f in os.listdir(publicDesktop):
if os.path.splitext(f)[1] in shortcutExtensions:
try:
userFile = os.path.join(userDesktop, f)
if os.path.exists(userFile):
os.remove(userFile)
shutil.move(os.path.join(publicDesktop, f), userDesktop)
except shutil.Error:
pass
Expand Down

0 comments on commit 8ac9c40

Please sign in to comment.