OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
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 os, sys, re, subprocess, shutil, buildtools | 7 import os, sys, re, subprocess, shutil, buildtools |
8 from getopt import getopt, GetoptError | 8 from getopt import getopt, GetoptError |
9 from StringIO import StringIO | 9 from StringIO import StringIO |
10 from zipfile import ZipFile | 10 from zipfile import ZipFile |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 print 'No target directory specified for the documentation' | 367 print 'No target directory specified for the documentation' |
368 usage(scriptName, type, 'docs') | 368 usage(scriptName, type, 'docs') |
369 return | 369 return |
370 targetDir = args[0] | 370 targetDir = args[0] |
371 | 371 |
372 command = ['jsdoc', | 372 command = ['jsdoc', |
373 '--destination', targetDir, | 373 '--destination', targetDir, |
374 '--access', 'all', | 374 '--access', 'all', |
375 os.path.join(baseDir, 'lib')] | 375 os.path.join(baseDir, 'lib')] |
376 if any(opt in ('-q', '--quiet') for opt, _ in opts): | 376 if any(opt in ('-q', '--quiet') for opt, _ in opts): |
377 subprocess.check_output(command) | 377 process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subproces
s.PIPE) |
| 378 stderr = process.communicate()[1] |
| 379 retcode = process.poll() |
| 380 if retcode: |
| 381 sys.stderr.write(stderr) |
| 382 raise subprocess.CalledProcessError(command, retcode) |
378 else: | 383 else: |
379 subprocess.check_call(command) | 384 subprocess.check_call(command) |
380 | 385 |
381 def runReleaseAutomation(baseDir, scriptName, opts, args, type): | 386 def runReleaseAutomation(baseDir, scriptName, opts, args, type): |
382 keyFiles = [] | 387 keyFiles = [] |
383 downloadsRepo = os.path.join(baseDir, '..', 'downloads') | 388 downloadsRepo = os.path.join(baseDir, '..', 'downloads') |
384 for option, value in opts: | 389 for option, value in opts: |
385 if option in ('-k', '--key'): | 390 if option in ('-k', '--key'): |
386 keyFiles.append(value) | 391 keyFiles.append(value) |
387 elif option in ('-d', '--downloads'): | 392 elif option in ('-d', '--downloads'): |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 if option in ('-h', '--help'): | 565 if option in ('-h', '--help'): |
561 usage(scriptName, type, command) | 566 usage(scriptName, type, command) |
562 sys.exit() | 567 sys.exit() |
563 commands[command](baseDir, scriptName, opts, args, type) | 568 commands[command](baseDir, scriptName, opts, args, type) |
564 else: | 569 else: |
565 print 'Command %s is not supported for this application type' % command | 570 print 'Command %s is not supported for this application type' % command |
566 usage(scriptName, type) | 571 usage(scriptName, type) |
567 else: | 572 else: |
568 print 'Command %s is unrecognized' % command | 573 print 'Command %s is unrecognized' % command |
569 usage(scriptName, type) | 574 usage(scriptName, type) |
OLD | NEW |