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: sdk/lib/_internal/pub/lib/src/command/downgrade.dart

Issue 521643005: Convert more pub code to use async/await. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise! Created 6 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
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 library pub.command.downgrade; 5 library pub.command.downgrade;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import '../command.dart'; 9 import '../command.dart';
10 import '../log.dart' as log; 10 import '../log.dart' as log;
(...skipping 10 matching lines...) Expand all
21 bool get isOffline => commandOptions['offline']; 21 bool get isOffline => commandOptions['offline'];
22 22
23 DowngradeCommand() { 23 DowngradeCommand() {
24 commandParser.addFlag('offline', 24 commandParser.addFlag('offline',
25 help: 'Use cached packages instead of accessing the network.'); 25 help: 'Use cached packages instead of accessing the network.');
26 26
27 commandParser.addFlag('dry-run', abbr: 'n', negatable: false, 27 commandParser.addFlag('dry-run', abbr: 'n', negatable: false,
28 help: "Report what dependencies would change but don't change any."); 28 help: "Report what dependencies would change but don't change any.");
29 } 29 }
30 30
31 Future onRun() { 31 Future onRun() async {
32 var dryRun = commandOptions['dry-run']; 32 var dryRun = commandOptions['dry-run'];
33 return entrypoint.acquireDependencies(SolveType.DOWNGRADE, 33 await entrypoint.acquireDependencies(SolveType.DOWNGRADE,
34 useLatest: commandOptions.rest, dryRun: dryRun).then((_) { 34 useLatest: commandOptions.rest, dryRun: dryRun);
35 if (isOffline) { 35 if (isOffline) {
36 log.warning("Warning: Downgrading when offline may not update you to " 36 log.warning("Warning: Downgrading when offline may not update you to "
37 "the oldest versions of your dependencies."); 37 "the oldest versions of your dependencies.");
38 } 38 }
39 });
40 } 39 }
41 } 40 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/cache_repair.dart ('k') | sdk/lib/_internal/pub/lib/src/command/serve.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698