-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathclear.py
More file actions
44 lines (34 loc) · 1.38 KB
/
clear.py
File metadata and controls
44 lines (34 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python
import os
import sys
import string
import subprocess
import shutil
from common import *
#main
def main():
ALL_TARGET = "vc" #default
if len(sys.argv) >= 1:
ALL_TARGET = sys.argv[1]
# print( ALL_TARGET )
# prebuild
for dir in os.listdir(os.getcwd()+"/prebuild"):
# print dir
if os.path.isdir(os.getcwd()+"/prebuild/"+dir):
for dir2 in os.listdir(os.getcwd()+"/prebuild/"+dir):
if os.path.isdir(os.getcwd()+"/prebuild/"+dir+"/"+dir2):
if(dir2 == "build_"+ALL_TARGET):
print (os.getcwd()+"/prebuild/"+dir+"/"+dir2)
# os.rmdir(os.getcwd()+"/prebuild/"+dir+"/"+dir2)
shutil.rmtree(os.getcwd()+"/prebuild/"+dir+"/"+dir2)
# projects
for dir in os.listdir(os.getcwd()+"/projects"):
# print dir
if os.path.isdir(os.getcwd()+"/projects/"+dir):
for dir2 in os.listdir(os.getcwd()+"/projects/"+dir):
if os.path.isdir(os.getcwd()+"/projects/"+dir+"/"+dir2):
if(dir2 == "build_"+ALL_TARGET):
print (os.getcwd()+"/projects/"+dir+"/"+dir2)
# os.rmdir(os.getcwd()+"/projects/"+dir+"/"+dir2)
shutil.rmtree(os.getcwd()+"/projects/"+dir+"/"+dir2)
main()