Chromium Code Reviews| 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..dd046f5570aa8944aaa9f314096f3c223c832ab7 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/io.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/io.dart |
| @@ -401,13 +401,16 @@ bool get runningFromSdk => Platform.script.path.endsWith('.snapshot'); |
| String resourcePath(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 readResource(String target) => readTextFile(resourcePath(target)); |
|
Bob Nystrom
2014/03/17 21:16:07
Ditto.
nweiz
2014/03/17 22:20:40
Done.
|
| + |
| /// 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 { |