From 9fd15f6fddf337e442a517f56be6cea5750fd6f9 Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Thu, 29 Sep 2022 10:08:54 -0400 Subject: [PATCH] fix: use os.remove instead of shutil.rmtree for symlinks (#1372) --- bench/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bench/app.py b/bench/app.py index 0ef69adb..0a13d4bd 100755 --- a/bench/app.py +++ b/bench/app.py @@ -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")