Skip to content

Commit

Permalink
Improve error handling for 'cleanup' command
Browse files Browse the repository at this point in the history
  • Loading branch information
chvancooten committed Feb 28, 2023
1 parent 1aed773 commit 63dfed9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions NimPlant.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,14 @@ def compile_nim(binary_type, xor_key, debug=False):
if input().lower() == "y":
print("Cleaning up...")

os.remove("server/nimplant.db")
rmtree("server/downloads")
rmtree("server/logs")
rmtree("server/uploads")
try:
os.remove("server/nimplant.db")
except OSError:
pass

rmtree("server/downloads", ignore_errors=True)
rmtree("server/logs", ignore_errors=True)
rmtree("server/uploads", ignore_errors=True)

print("Cleaned up NimPlant server files!")
else:
Expand Down

0 comments on commit 63dfed9

Please sign in to comment.