| 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 e05713dbbaa1038d020f80d026a70a8bc2f1d745..8c242fe779034e97b7aaa79ddbb4953a9d39a334 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/io.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/io.dart
|
| @@ -398,16 +398,19 @@ void createPackageSymlink(String name, String target, String symlink,
|
| bool get runningFromSdk => Platform.script.path.endsWith('.snapshot');
|
|
|
| /// Resolves [target] relative to the path to pub's `resource` directory.
|
| -String resourcePath(String target) {
|
| +String assetPath(String target) {
|
| if (runningFromSdk) {
|
| return path.join(
|
| - sdk.rootDirectory, 'lib', '_internal', 'pub', 'resource', target);
|
| + sdk.rootDirectory, 'lib', '_internal', 'pub', 'asset', target);
|
| } else {
|
| return path.join(
|
| - path.dirname(libraryPath('pub.io')), '..', '..', 'resource', target);
|
| + path.dirname(libraryPath('pub.io')), '..', '..', 'asset', target);
|
| }
|
| }
|
|
|
| +/// Reads a text file from pub's `resource` directory.
|
| +String readAsset(String target) => readTextFile(assetPath(target));
|
| +
|
| /// Returns the path to the root of the Dart repository. This will throw a
|
| /// [StateError] if it's called when running pub from the SDK.
|
| String get repoRoot {
|
| @@ -722,7 +725,7 @@ Future<bool> extractTarGz(Stream<List<int>> stream, String destination) {
|
| }
|
|
|
| String get pathTo7zip {
|
| - if (runningFromSdk) return resourcePath(path.join('7zip', '7za.exe'));
|
| + if (runningFromSdk) return assetPath(path.join('7zip', '7za.exe'));
|
| return path.join(repoRoot, 'third_party', '7zip', '7za.exe');
|
| }
|
|
|
|
|