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

Side by Side Diff: lib/src/command/lish.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 4 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
« no previous file with comments | « lib/src/command/global_activate.dart ('k') | lib/src/command/list_package_dirs.dart » ('j') | 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:http/http.dart' as http; 7 import 'package:http/http.dart' as http;
8 8
9 import '../command.dart'; 9 import '../command.dart';
10 import '../exit_codes.dart' as exit_codes; 10 import '../exit_codes.dart' as exit_codes;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 LishCommand() { 50 LishCommand() {
51 argParser.addFlag('dry-run', abbr: 'n', negatable: false, 51 argParser.addFlag('dry-run', abbr: 'n', negatable: false,
52 help: 'Validate but do not publish the package.'); 52 help: 'Validate but do not publish the package.');
53 argParser.addFlag('force', abbr: 'f', negatable: false, 53 argParser.addFlag('force', abbr: 'f', negatable: false,
54 help: 'Publish without confirmation if there are no errors.'); 54 help: 'Publish without confirmation if there are no errors.');
55 argParser.addOption('server', defaultsTo: cache.sources.hosted.defaultUrl, 55 argParser.addOption('server', defaultsTo: cache.sources.hosted.defaultUrl,
56 help: 'The package server to which to upload this package.'); 56 help: 'The package server to which to upload this package.');
57 } 57 }
58 58
59 Future _publish(packageBytes) async { 59 Future _publish(List<int> packageBytes) async {
60 var cloudStorageUrl; 60 var cloudStorageUrl;
61 try { 61 try {
62 await oauth2.withClient(cache, (client) { 62 await oauth2.withClient(cache, (client) {
63 return log.progress('Uploading', () async { 63 return log.progress('Uploading', () async {
64 // TODO(nweiz): Cloud Storage can provide an XML-formatted error. We 64 // TODO(nweiz): Cloud Storage can provide an XML-formatted error. We
65 // should report that error and exit. 65 // should report that error and exit.
66 var newUri = server.resolve("/api/packages/versions/new"); 66 var newUri = server.resolve("/api/packages/versions/new");
67 var response = await client.get(newUri, headers: PUB_API_HEADERS); 67 var response = await client.get(newUri, headers: PUB_API_HEADERS);
68 var parameters = parseJsonResponse(response); 68 var parameters = parseJsonResponse(response);
69 69
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 var confirmed = await confirm(message); 181 var confirmed = await confirm(message);
182 if (!confirmed) { 182 if (!confirmed) {
183 log.error("Package upload canceled."); 183 log.error("Package upload canceled.");
184 return false; 184 return false;
185 } 185 }
186 return true; 186 return true;
187 } 187 }
188 } 188 }
OLDNEW
« no previous file with comments | « lib/src/command/global_activate.dart ('k') | lib/src/command/list_package_dirs.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698