| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 """Helper for building and deploying Observatory""" | 5 """Helper for building and deploying Observatory""" |
| 6 | 6 |
| 7 import argparse | 7 import argparse |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import shutil | 10 import shutil |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 in the tools/observatory_tool.py script. | 52 in the tools/observatory_tool.py script. |
| 53 | 53 |
| 54 """ | 54 """ |
| 55 | 55 |
| 56 def DisplayFailureMessage(): | 56 def DisplayFailureMessage(): |
| 57 print """\ | 57 print """\ |
| 58 | 58 |
| 59 ERROR: Observatory failed to build. What should you do? | 59 ERROR: Observatory failed to build. What should you do? |
| 60 | 60 |
| 61 1. Revert to a working revision of the Dart VM | 61 1. Revert to a working revision of the Dart VM |
| 62 2. Contact zra@, johnmccutchan@, dart-vm-team@ | 62 2. Contact zra@, rmacnak@, dart-vm-team@ |
| 63 3. File a bug: https://github.com/dart-lang/sdk/issues/new | 63 3. File a bug: https://github.com/dart-lang/sdk/issues/new |
| 64 | 64 |
| 65 """ | 65 """ |
| 66 | 66 |
| 67 # Run |command|. If its return code is 0, return 0 and swallow its output. | 67 # Run |command|. If its return code is 0, return 0 and swallow its output. |
| 68 # If its return code is non-zero, emit its output unless |always_silent| is | 68 # If its return code is non-zero, emit its output unless |always_silent| is |
| 69 # True, and return the return code. | 69 # True, and return the return code. |
| 70 def RunCommand(command, always_silent=False): | 70 def RunCommand(command, always_silent=False): |
| 71 try: | 71 try: |
| 72 # Dart IO respects the following environment variables to configure the | 72 # Dart IO respects the following environment variables to configure the |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 result = ExecuteCommand(options, args) | 259 result = ExecuteCommand(options, args) |
| 260 if result == 0: | 260 if result == 0: |
| 261 CreateTimestampFile(options) | 261 CreateTimestampFile(options) |
| 262 return result | 262 return result |
| 263 except: | 263 except: |
| 264 DisplayFailureMessage() | 264 DisplayFailureMessage() |
| 265 | 265 |
| 266 | 266 |
| 267 if __name__ == '__main__': | 267 if __name__ == '__main__': |
| 268 sys.exit(main()); | 268 sys.exit(main()); |
| OLD | NEW |