diff --git a/lib/src/io.dart b/lib/src/io.dart index f61f47e5f7fdb6a532e0341d67b71c5cca3cd909..66477f5e605cb4186a410a6bad92da89a8819745 100644 --- a/lib/src/io.dart +++ b/lib/src/io.dart @@ -368,7 +368,7 @@ void createPackageSymlink(String name, String target, String symlink, /// Whether pub is running from within the Dart SDK, as opposed to from the Dart /// source repository. -bool get runningFromSdk => path.extension(new Options().script) == '.snapshot'; +bool get runningFromSdk => path.extension(Platform.script) == '.snapshot'; /// Resolves [target] relative to the path to pub's `resource` directory. String resourcePath(String target) { diff --git a/lib/src/sdk.dart b/lib/src/sdk.dart index 0fbe5f966eeb3fb69f4c2272d999ce4868dcfd5b..7f4e26a2d10d8200b63f898983f37e20af897a0d 100644 --- a/lib/src/sdk.dart +++ b/lib/src/sdk.dart @@ -29,7 +29,7 @@ String get rootDirectory { } // Assume the Dart executable is always coming from the SDK. - return path.dirname(path.dirname(new Options().executable)); + return path.dirname(path.dirname(Platform.executable)); } /// Gets the SDK's revision number formatted to be a semantic version. diff --git a/test/test_pub.dart b/test/test_pub.dart index a5fcd1688263dfbf49a431834fd177a1ca6529b4..c35ab69efa0e0075817813ff9dac81433dffd156 100644 --- a/test/test_pub.dart +++ b/test/test_pub.dart @@ -436,7 +436,7 @@ ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) { // Find a Dart executable we can use to spawn. Use the same one that was // used to run this script itself. - var dartBin = new Options().executable; + var dartBin = Platform.executable; // If the executable looks like a path, get its full path. That way we // can still find it when we spawn it with a different working directory. @@ -555,7 +555,7 @@ class PubProcess extends ScheduledProcess { /// The path to the `packages` directory from which pub loads its dependencies. String get _packageRoot { return path.absolute(path.join( - path.dirname(new Options().executable), '..', '..', 'packages')); + path.dirname(Platform.executable), '..', '..', 'packages')); } /// Skips the current test if Git is not installed. This validates that the