Add option to clean.py to only remove dist and out dirs
This commit is contained in:
parent
8060b0966f
commit
2d638e5da7
6 changed files with 33 additions and 29 deletions
|
@ -123,7 +123,7 @@ To clean only `out` and `dist` directories:
|
||||||
$ npm run clean-build
|
$ npm run clean-build
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that both commands will require to do run bootstrap again .
|
**Note:** Both clean commands require running `bootstrap` again before building.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ To clean only `out` and `dist` directories:
|
||||||
$ npm run clean-build
|
$ npm run clean-build
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that both commands will require to do run bootstrap again .
|
**Note:** Both clean commands require running `bootstrap` again before building.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ To clean only `out` and `dist` directories:
|
||||||
$ npm run clean-build
|
$ npm run clean-build
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that both commands will require to do run bootstrap again .
|
**Note:** Both clean commands require running `bootstrap` again before building.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
"bump-version": "./script/bump-version.py",
|
"bump-version": "./script/bump-version.py",
|
||||||
"build": "python ./script/build.py -c D",
|
"build": "python ./script/build.py -c D",
|
||||||
"clean": "python ./script/clean.py",
|
"clean": "python ./script/clean.py",
|
||||||
"clean-build": "python ./script/clean-build.py",
|
"clean-build": "python ./script/clean.py --build",
|
||||||
"coverage": "npm run instrument-code-coverage && npm test -- --use-instrumented-asar",
|
"coverage": "npm run instrument-code-coverage && npm test -- --use-instrumented-asar",
|
||||||
"instrument-code-coverage": "electabul instrument --input-path ./lib --output-path ./out/coverage/electron.asar",
|
"instrument-code-coverage": "electabul instrument --input-path ./lib --output-path ./out/coverage/electron.asar",
|
||||||
"lint": "npm run lint-js && npm run lint-cpp && npm run lint-py && npm run lint-api-docs-js && npm run lint-api-docs",
|
"lint": "npm run lint-js && npm run lint-cpp && npm run lint-py && npm run lint-api-docs-js && npm run lint-api-docs",
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
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)
|
|
||||||
rm_rf('dist')
|
|
||||||
rm_rf('out')
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.exit(main())
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -11,13 +12,34 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
os.chdir(SOURCE_ROOT)
|
os.chdir(SOURCE_ROOT)
|
||||||
rm_rf('node_modules')
|
|
||||||
rm_rf('dist')
|
args = parse_args()
|
||||||
rm_rf('out')
|
|
||||||
rm_rf('spec/node_modules')
|
remove_directory('dist')
|
||||||
rm_rf('vendor/brightray/vendor/download/libchromiumcontent')
|
remove_directory('out')
|
||||||
rm_rf('vendor/brightray/vendor/libchromiumcontent/src')
|
|
||||||
rm_rf(os.path.expanduser('~/.node-gyp'))
|
if not args.build:
|
||||||
|
remove_directory('node_modules')
|
||||||
|
remove_directory('spec/node_modules')
|
||||||
|
|
||||||
|
remove_directory('vendor/brightray/vendor/download/libchromiumcontent')
|
||||||
|
remove_directory('vendor/brightray/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__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue