OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
4 # License, v. 2.0. If a copy of the MPL was not distributed with this | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
6 | 6 |
7 import sys | 7 import sys |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import re | 10 import re |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 for l in file_content: | 419 for l in file_content: |
420 print >>f, l | 420 print >>f, l |
421 | 421 |
422 | 422 |
423 if __name__ == '__main__': | 423 if __name__ == '__main__': |
424 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) | 424 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) |
425 | 425 |
426 parser = argparse.ArgumentParser(description='Verify dependencies for a set
of repositories, by default the repository of this script.') | 426 parser = argparse.ArgumentParser(description='Verify dependencies for a set
of repositories, by default the repository of this script.') |
427 parser.add_argument('repos', metavar='repository', type=str, nargs='*', help
='Repository path') | 427 parser.add_argument('repos', metavar='repository', type=str, nargs='*', help
='Repository path') |
428 parser.add_argument('-q', '--quiet', action='store_true', help='Suppress inf
ormational output') | 428 parser.add_argument('-q', '--quiet', action='store_true', help='Suppress inf
ormational output') |
| 429 parser.add_argument( |
| 430 '--nodejs-only', |
| 431 action='store_true', |
| 432 help='Install Node.js production-only dependencies only' |
| 433 ) |
429 args = parser.parse_args() | 434 args = parser.parse_args() |
430 | 435 |
431 if args.quiet: | 436 if args.quiet: |
432 logging.disable(logging.INFO) | 437 logging.disable(logging.INFO) |
433 | 438 |
434 repos = args.repos | 439 if args.nodejs_only: |
435 if not len(repos): | 440 resolve_npm_dependencies('.', get_repo_type('.')) |
436 repos = [os.path.dirname(__file__)] | 441 else: |
437 for repo in repos: | 442 repos = args.repos |
438 resolve_deps(repo) | 443 if not len(repos): |
| 444 repos = [os.path.dirname(__file__)] |
| 445 for repo in repos: |
| 446 resolve_deps(repo) |
OLD | NEW |