| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:args/args.dart'; | 8 import 'package:args/args.dart'; |
| 9 import 'package:args/command_runner.dart'; | 9 import 'package:args/command_runner.dart'; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 if (options['trace']) { | 137 if (options['trace']) { |
| 138 log.dumpTranscript(); | 138 log.dumpTranscript(); |
| 139 } else if (!isUserFacingException(error)) { | 139 } else if (!isUserFacingException(error)) { |
| 140 // TODO(23505): Implement proper shell escaping, not a partial hack. | 140 // TODO(23505): Implement proper shell escaping, not a partial hack. |
| 141 protectArgument(String x) => x.contains(' ') ? '"$x"' : x; | 141 protectArgument(String x) => x.contains(' ') ? '"$x"' : x; |
| 142 log.error(""" | 142 log.error(""" |
| 143 This is an unexpected error. Please run | 143 This is an unexpected error. Please run |
| 144 | 144 |
| 145 pub --trace ${options.arguments.map(protectArgument).join(' ')} | 145 pub --trace ${options.arguments.map(protectArgument).join(' ')} |
| 146 | 146 |
| 147 and include the results in a bug report on http://dartbug.com/new. | 147 and include the logs in an issue on https://github.com/dart-lang/pub/issues/new |
| 148 """); | 148 """); |
| 149 } | 149 } |
| 150 | 150 |
| 151 await flushThenExit(_chooseExitCode(error)); | 151 await flushThenExit(_chooseExitCode(error)); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 void printUsage() { | 155 void printUsage() { |
| 156 log.message(usage); | 156 log.message(usage); |
| 157 } | 157 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 Future _validatePlatform() async { | 213 Future _validatePlatform() async { |
| 214 if (Platform.operatingSystem != 'windows') return; | 214 if (Platform.operatingSystem != 'windows') return; |
| 215 | 215 |
| 216 var result = await runProcess('ver', []); | 216 var result = await runProcess('ver', []); |
| 217 if (result.stdout.join('\n').contains('XP')) { | 217 if (result.stdout.join('\n').contains('XP')) { |
| 218 log.error('Sorry, but pub is not supported on Windows XP.'); | 218 log.error('Sorry, but pub is not supported on Windows XP.'); |
| 219 await flushThenExit(exit_codes.USAGE); | 219 await flushThenExit(exit_codes.USAGE); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 } | 222 } |
| OLD | NEW |