forked from adamlaska/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.py
More file actions
executable file
·46 lines (29 loc) · 1.01 KB
/
clean.py
File metadata and controls
executable file
·46 lines (29 loc) · 1.01 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
42
43
44
45
46
#!/usr/bin/env python
import argparse
import os
import sys
from lib.util import rm_rf
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main():
os.chdir(SOURCE_ROOT)
args = parse_args()
remove_directory('dist')
remove_directory('out')
if not args.build:
remove_directory('node_modules')
remove_directory('spec/node_modules')
remove_directory('vendor/download/libchromiumcontent')
remove_directory('vendor/libchromiumcontent/src')
remove_directory(os.path.expanduser('~/.node-gyp'))
def parse_args():
parser = argparse.ArgumentParser(description='Remove generated and' \
'downloaded build files')
parser.add_argument('-b', '--build',
help='Only remove out and dist directories',
action='store_true')
return parser.parse_args()
def remove_directory(directory):
print 'Removing %s' % directory
rm_rf(directory)
if __name__ == '__main__':
sys.exit(main())