From 44236186814427a46c0349356e5d44cc0aaf9b35 Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Fri, 3 Dec 2021 16:37:11 +0000 Subject: [PATCH] [WS] Add script to cleanup (unsetup?) workspace git-svn-id: svn://kolibrios.org@9371 a494cfbc-eb01-0410-851d-a64ba20cac60 --- _tools/cleanup.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 _tools/cleanup.py diff --git a/_tools/cleanup.py b/_tools/cleanup.py new file mode 100755 index 0000000000..c25e2717f6 --- /dev/null +++ b/_tools/cleanup.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +import os +import sys +import shutil + +if len(sys.argv) < 2 or sys.argv[1] != "--remove-everything": + print(f"Please call `{sys.argv[0]} --remove-everything` if you really want to remove all your workspace files") + exit() + +# Remove workspace folder +shutil.rmtree("workspace", ignore_errors = True) + +# TODO: Make build.py remove the stuff it built + +# Remove files copied from _tools/workspace +tools = os.path.dirname(os.path.realpath(__file__)) +tools_workspace = os.path.join(tools, "workspace") +for copied_script in os.listdir(tools_workspace): + if os.path.exists(copied_script): + os.remove(copied_script) +