| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import '../command.dart'; | 7 import '../command.dart'; |
| 8 import '../log.dart' as log; | 8 import '../log.dart' as log; |
| 9 import '../solver/version_solver.dart'; | 9 import '../solver/version_solver.dart'; |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 UpgradeCommand() { | 22 UpgradeCommand() { |
| 23 argParser.addFlag('offline', | 23 argParser.addFlag('offline', |
| 24 help: 'Use cached packages instead of accessing the network.'); | 24 help: 'Use cached packages instead of accessing the network.'); |
| 25 | 25 |
| 26 argParser.addFlag('dry-run', abbr: 'n', negatable: false, | 26 argParser.addFlag('dry-run', abbr: 'n', negatable: false, |
| 27 help: "Report what dependencies would change but don't change any."); | 27 help: "Report what dependencies would change but don't change any."); |
| 28 | 28 |
| 29 argParser.addFlag('precompile', defaultsTo: true, | 29 argParser.addFlag('precompile', defaultsTo: true, |
| 30 help: "Precompile executables and transformed dependencies."); | 30 help: "Precompile executables and transformed dependencies."); |
| 31 |
| 32 argParser.addFlag('packages-dir', |
| 33 negatable: true, defaultsTo: true, |
| 34 help: "Generate a packages/ directory when installing packages."); |
| 31 } | 35 } |
| 32 | 36 |
| 33 Future run() async { | 37 Future run() async { |
| 34 await entrypoint.acquireDependencies(SolveType.UPGRADE, | 38 await entrypoint.acquireDependencies(SolveType.UPGRADE, |
| 35 useLatest: argResults.rest, | 39 useLatest: argResults.rest, |
| 36 dryRun: argResults['dry-run'], | 40 dryRun: argResults['dry-run'], |
| 37 precompile: argResults['precompile']); | 41 precompile: argResults['precompile'], |
| 42 packagesDir: argResults['packages-dir']); |
| 38 | 43 |
| 39 if (isOffline) { | 44 if (isOffline) { |
| 40 log.warning("Warning: Upgrading when offline may not update you to the " | 45 log.warning("Warning: Upgrading when offline may not update you to the " |
| 41 "latest versions of your dependencies."); | 46 "latest versions of your dependencies."); |
| 42 } | 47 } |
| 43 } | 48 } |
| 44 } | 49 } |
| OLD | NEW |