Unverified Commit 549e8e07 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Support launching flutter_tools from a package URI (#23476)

parent d00a549f
...@@ -183,6 +183,12 @@ class FlutterCommandRunner extends CommandRunner<void> { ...@@ -183,6 +183,12 @@ class FlutterCommandRunner extends CommandRunner<void> {
try { try {
if (platform.script.scheme == 'data') if (platform.script.scheme == 'data')
return '../..'; // we're running as a test return '../..'; // we're running as a test
if (platform.script.scheme == 'package') {
final String packageConfigPath = Uri.parse(platform.packageConfig).toFilePath();
return fs.path.dirname(fs.path.dirname(fs.path.dirname(packageConfigPath)));
}
final String script = platform.script.toFilePath(); final String script = platform.script.toFilePath();
if (fs.path.basename(script) == kSnapshotFileName) if (fs.path.basename(script) == kSnapshotFileName)
return fs.path.dirname(fs.path.dirname(fs.path.dirname(script))); return fs.path.dirname(fs.path.dirname(fs.path.dirname(script)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment