2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-06 23:44:03 +00:00

fix: use os.remove instead of shutil.rmtree for symlinks (#1372)

This commit is contained in:
Devin Slauenwhite 2022-09-29 10:08:54 -04:00 committed by GitHub
parent fcbc2eaa47
commit 9fd15f6fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,7 +201,10 @@ class App(AppMeta):
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")