| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /// The main entrypoint for the pub command line application. | 5 /// The main entrypoint for the pub command line application. |
| 6 library pub; | 6 library pub; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import '../../pkg/args/lib/args.dart'; | 9 import '../../pkg/args/lib/args.dart'; |
| 10 import '../../pkg/path/lib/path.dart' as path; | 10 import '../../pkg/path/lib/path.dart' as path; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 default: | 102 default: |
| 103 // No specific verbosity given, so check for the shortcut. | 103 // No specific verbosity given, so check for the shortcut. |
| 104 if (globalOptions['verbose']) { | 104 if (globalOptions['verbose']) { |
| 105 log.showAll(); | 105 log.showAll(); |
| 106 } else { | 106 } else { |
| 107 log.showNormal(); | 107 log.showNormal(); |
| 108 } | 108 } |
| 109 break; | 109 break; |
| 110 } | 110 } |
| 111 | 111 |
| 112 SecureSocket.initialize(database: relativeToPub('resource/certs')); |
| 113 |
| 112 var cacheDir; | 114 var cacheDir; |
| 113 if (Platform.environment.containsKey('PUB_CACHE')) { | 115 if (Platform.environment.containsKey('PUB_CACHE')) { |
| 114 cacheDir = Platform.environment['PUB_CACHE']; | 116 cacheDir = Platform.environment['PUB_CACHE']; |
| 115 } else if (Platform.operatingSystem == 'windows') { | 117 } else if (Platform.operatingSystem == 'windows') { |
| 116 var appData = Platform.environment['APPDATA']; | 118 var appData = Platform.environment['APPDATA']; |
| 117 cacheDir = join(appData, 'Pub', 'Cache'); | 119 cacheDir = join(appData, 'Pub', 'Cache'); |
| 118 } else { | 120 } else { |
| 119 cacheDir = '${Platform.environment['HOME']}/.pub-cache'; | 121 cacheDir = '${Platform.environment['HOME']}/.pub-cache'; |
| 120 } | 122 } |
| 121 | 123 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 if (exception is HttpException || exception is HttpParserException || | 301 if (exception is HttpException || exception is HttpParserException || |
| 300 exception is SocketIOException || exception is PubHttpException) { | 302 exception is SocketIOException || exception is PubHttpException) { |
| 301 return exit_codes.UNAVAILABLE; | 303 return exit_codes.UNAVAILABLE; |
| 302 } else if (exception is FormatException) { | 304 } else if (exception is FormatException) { |
| 303 return exit_codes.DATA; | 305 return exit_codes.DATA; |
| 304 } else { | 306 } else { |
| 305 return 1; | 307 return 1; |
| 306 } | 308 } |
| 307 } | 309 } |
| 308 } | 310 } |
| OLD | NEW |