Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: utils/pub/pub.dart

Issue 10970025: Beat on hosted repo support on Windows a bit more. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/io.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 5 /**
6 * The main entrypoint for the pub command line application. 6 * The main entrypoint for the pub command line application.
7 */ 7 */
8 #library('pub'); 8 #library('pub');
9 9
10 #import('../../pkg/args/lib/args.dart'); 10 #import('../../pkg/args/lib/args.dart');
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 // TODO(nweiz): Have a fallback for this this out automatically once 1145 is 76 // TODO(nweiz): Have a fallback for this this out automatically once 1145 is
77 // fixed. 77 // fixed.
78 var sdkDir = Platform.environment['DART_SDK']; 78 var sdkDir = Platform.environment['DART_SDK'];
79 var cacheDir; 79 var cacheDir;
80 if (Platform.environment.containsKey('PUB_CACHE')) { 80 if (Platform.environment.containsKey('PUB_CACHE')) {
81 cacheDir = Platform.environment['PUB_CACHE']; 81 cacheDir = Platform.environment['PUB_CACHE'];
82 } else if (Platform.operatingSystem == 'windows') { 82 } else if (Platform.operatingSystem == 'windows') {
83 var appData = Platform.environment['APPDATA']; 83 var appData = Platform.environment['APPDATA'];
84 cacheDir = join(appData, 'Pub', 'Package Cache'); 84 cacheDir = join(appData, 'Pub', 'Cache');
85 } else { 85 } else {
86 cacheDir = '${Platform.environment['HOME']}/.pub-cache'; 86 cacheDir = '${Platform.environment['HOME']}/.pub-cache';
87 } 87 }
88 88
89 var cache = new SystemCache(cacheDir); 89 var cache = new SystemCache(cacheDir);
90 cache.register(new SdkSource(sdkDir)); 90 cache.register(new SdkSource(sdkDir));
91 cache.register(new GitSource()); 91 cache.register(new GitSource());
92 cache.register(new HostedSource()); 92 cache.register(new HostedSource());
93 cache.sources.setDefault('hosted'); 93 cache.sources.setDefault('hosted');
94 94
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (exception is HttpException || exception is HttpParserException || 264 if (exception is HttpException || exception is HttpParserException ||
265 exception is SocketIOException || exception is PubHttpException) { 265 exception is SocketIOException || exception is PubHttpException) {
266 return exit_codes.UNAVAILABLE; 266 return exit_codes.UNAVAILABLE;
267 } else if (exception is FormatException) { 267 } else if (exception is FormatException) {
268 return exit_codes.DATA; 268 return exit_codes.DATA;
269 } else { 269 } else {
270 return 1; 270 return 1;
271 } 271 }
272 } 272 }
273 } 273 }
OLDNEW
« no previous file with comments | « utils/pub/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698