Index: sdk/lib/_internal/pub/lib/src/io.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart |
index 58a52ef00eaf0e412fb618ec23763f836da0273f..abf9531dc9305485c3360ea80caececb01881cea 100644 |
--- a/sdk/lib/_internal/pub/lib/src/io.dart |
+++ b/sdk/lib/_internal/pub/lib/src/io.dart |
@@ -485,11 +485,13 @@ String assetPath(String target) { |
return path.join( |
sdk.rootDirectory, 'lib', '_internal', 'pub', 'asset', target); |
} else { |
- return path.join( |
- path.dirname(libraryPath('pub.io')), '..', '..', 'asset', target); |
+ return path.join(pubRoot, 'asset', target); |
} |
} |
+/// Returns the path to the root of pub's sources in the Dart repo. |
+String get pubRoot => path.join(repoRoot, 'sdk', 'lib', '_internal', 'pub'); |
+ |
/// Returns the path to the root of the Dart repository. |
/// |
/// This throws a [StateError] if it's called when running pub from the SDK. |