| Index: utils/pub/pub.dart
|
| diff --git a/utils/pub/pub.dart b/utils/pub/pub.dart
|
| index 6ed5b269d50a13a135131cb64e7cf0f7c04cc8df..dae4dea554618f2191dd0b5c114c246676306ea3 100644
|
| --- a/utils/pub/pub.dart
|
| +++ b/utils/pub/pub.dart
|
| @@ -16,6 +16,7 @@
|
| #source('package.dart');
|
|
|
| Map<String, PubCommand> commands;
|
| +PackageCache cache;
|
|
|
| main() {
|
| final args = new Options().arguments;
|
| @@ -25,6 +26,7 @@ main() {
|
| // be consistent with other Unix apps.
|
| commands = {
|
| 'list': new PubCommand('print the contents of repositories', commandList),
|
| + 'update': new PubCommand("update a package's dependencies", commandUpdate),
|
| 'version': new PubCommand('print Pub version', commandVersion)
|
| };
|
|
|
| @@ -45,6 +47,9 @@ main() {
|
| }
|
| }
|
|
|
| + // TODO(rnystrom): Do we want this to be global?
|
| + cache = new PackageCache(cacheDir);
|
| +
|
| var options = new PubOptions(cacheDir);
|
|
|
| // Select the command.
|
| @@ -96,6 +101,17 @@ void commandVersion(PubOptions options, List<String> args) {
|
| print('Pub 0.0.0');
|
| }
|
|
|
| +/**
|
| + * Gets the package that contains the current working directory. In other words,
|
| + * finds the package that the user is currently "in".
|
| + */
|
| +Future<Package> getWorkingPackage() {
|
| + // TODO(rnystrom): Will eventually need better logic to walk up
|
| + // subdirectories until we hit one that looks package-like. For now, just
|
| + // assume the cwd is it.
|
| + return Package.load(workingDir);
|
| +}
|
| +
|
| typedef void CommandFunction(PubOptions options, List<String> args);
|
|
|
| class PubCommand {
|
|
|