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 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 Loading... |
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 } |
OLD | NEW |