Skip to content

Commit

Permalink
fix: use os.remove instead of shutil.rmtree for symlinks (frappe#1372)
Browse files Browse the repository at this point in the history
  • Loading branch information
dj12djdjs authored Sep 29, 2022
1 parent fcbc2ea commit 9fd15f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ def remove(self, no_backup: bool = False):
active_app_path = os.path.join("apps", self.name)

if no_backup:
shutil.rmtree(active_app_path)
if not os.path.islink(active_app_path):
shutil.rmtree(active_app_path)
else:
os.remove(active_app_path)
log(f"App deleted from {active_app_path}")
else:
archived_path = os.path.join("archived", "apps")
Expand Down

0 comments on commit 9fd15f6

Please sign in to comment.