Subversion Repositories Kolibri OS

Rev

Rev 9377 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #!/usr/bin/python3
  2. import os
  3. import sys
  4. import shutil
  5.  
  6. import workspace.build
  7.  
  8. if len(sys.argv) < 2 or sys.argv[1] != "--remove-everything":
  9.     print(f"Please call `{sys.argv[0]} --remove-everything` if you really want to remove all your workspace files")
  10.     exit()
  11.  
  12. # Remove workspace folder
  13. shutil.rmtree("workspace", ignore_errors = True)
  14.  
  15. # Remove tup database
  16. shutil.rmtree(".tup", ignore_errors = True)
  17.  
  18. # Make build.py remove the stuff it built
  19. workspace.build.clean()
  20.  
  21. # Remove files copied from _tools/workspace
  22. tools = os.path.dirname(os.path.realpath(__file__))
  23. tools_workspace = os.path.join(tools, "workspace")
  24. for copied_script in os.listdir(tools_workspace):
  25.     if os.path.exists(copied_script):
  26.         os.remove(copied_script)
  27.  
  28.