Chromium Code Reviews

Side by Side Diff: lib/src/source/path.dart

Issue 1282533003: Don't implicitly run "pub get". (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « lib/src/package_graph.dart ('k') | test/barback/all_includes_all_default_directories_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.source.path; 5 library pub.source.path;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:path/path.dart' as p; 9 import 'package:path/path.dart' as p;
10 10
(...skipping 39 matching lines...)
50 } 50 }
51 51
52 Future get(PackageId id, String symlink) { 52 Future get(PackageId id, String symlink) {
53 return new Future.sync(() { 53 return new Future.sync(() {
54 var dir = _validatePath(id.name, id.description); 54 var dir = _validatePath(id.name, id.description);
55 createPackageSymlink(id.name, dir, symlink, 55 createPackageSymlink(id.name, dir, symlink,
56 relative: id.description["relative"]); 56 relative: id.description["relative"]);
57 }); 57 });
58 } 58 }
59 59
60 String getDirectory(PackageId id) => _validatePath(id.name, id.description); 60 String getDirectory(PackageId id) => id.description["path"];
61 61
62 /// Parses a path dependency. 62 /// Parses a path dependency.
63 /// 63 ///
64 /// This takes in a path string and returns a map. The "path" key will be the 64 /// This takes in a path string and returns a map. The "path" key will be the
65 /// original path but resolved relative to the containing path. The 65 /// original path but resolved relative to the containing path. The
66 /// "relative" key will be `true` if the original path was relative. 66 /// "relative" key will be `true` if the original path was relative.
67 /// 67 ///
68 /// A path coming from a pubspec is a simple string. From a lock file, it's 68 /// A path coming from a pubspec is a simple string. From a lock file, it's
69 /// an expanded {"path": ..., "relative": ...} map. 69 /// an expanded {"path": ..., "relative": ...} map.
70 dynamic parseDescription(String containingPath, description, 70 dynamic parseDescription(String containingPath, description,
(...skipping 79 matching lines...)
150 150
151 if (fileExists(dir)) { 151 if (fileExists(dir)) {
152 fail('Path dependency for package $name must refer to a directory, ' 152 fail('Path dependency for package $name must refer to a directory, '
153 'not a file. Was "$dir".'); 153 'not a file. Was "$dir".');
154 } 154 }
155 155
156 throw new PackageNotFoundException( 156 throw new PackageNotFoundException(
157 'Could not find package $name at "$dir".'); 157 'Could not find package $name at "$dir".');
158 } 158 }
159 } 159 }
OLDNEW
« no previous file with comments | « lib/src/package_graph.dart ('k') | test/barback/all_includes_all_default_directories_test.dart » ('j') | no next file with comments »

Powered by Google App Engine