Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: utils/pub/source.dart

Issue 12255016: Get rid of old redundant methods in io.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: utils/pub/source.dart
diff --git a/utils/pub/source.dart b/utils/pub/source.dart
index 777c1a0222fc8f8ffbd1e4e9229cc5ca77009279..5f79e2986bfd8059c11b66503fe06119194daa64 100644
--- a/utils/pub/source.dart
+++ b/utils/pub/source.dart
@@ -5,6 +5,9 @@
library source;
import 'dart:async';
+
+import '../../pkg/path/lib/path.dart' as path;
+
import 'io.dart';
import 'package.dart';
import 'pubspec.dart';
@@ -105,15 +108,15 @@ abstract class Source {
///
/// By default, this uses [systemCacheDirectory] and [install].
Future<Package> installToSystemCache(PackageId id) {
- var path;
+ var packageDir;
return systemCacheDirectory(id).then((p) {
- path = p;
- if (dirExists(path)) return true;
- ensureDir(dirname(path));
- return install(id, path);
+ packageDir = p;
+ if (dirExists(packageDir)) return true;
+ ensureDir(path.dirname(packageDir));
+ return install(id, packageDir);
}).then((found) {
if (!found) throw 'Package $id not found.';
- return new Package.load(id.name, path, systemCache.sources);
+ return new Package.load(id.name, packageDir, systemCache.sources);
});
}
« utils/pub/io.dart ('K') | « utils/pub/pub.dart ('k') | utils/pub/system_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698