Commit 3c9c3133 authored by Adam Barth's avatar Adam Barth

run_mojo can't find ArtifactStore.packageRoot

The `run_mojo` command doesn't integrate with `FlutterCommand` and doesn't
understand how to download its toolchain components ahead of time. Eventually
we should teach `run_mojo` how to integrate with the `Toolchain` class, but
until then, we can fix the regression by eagerly setting
`ArtifactStore.packageRoot` again.

Fixes https://github.com/domokit/mojo/issues/475
parent db6a7abd
...@@ -102,11 +102,12 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -102,11 +102,12 @@ class FlutterCommandRunner extends CommandRunner {
Logger.root.level = Level.FINE; Logger.root.level = Level.FINE;
_globalResults = globalResults; _globalResults = globalResults;
ArtifactStore.packageRoot = globalResults['package-root'];
return super.runCommand(globalResults); return super.runCommand(globalResults);
} }
List<BuildConfiguration> _createBuildConfigurations(ArgResults globalResults) { List<BuildConfiguration> _createBuildConfigurations(ArgResults globalResults) {
ArtifactStore.packageRoot = globalResults['package-root'];
if (!FileSystemEntity.isDirectorySync(ArtifactStore.packageRoot)) { if (!FileSystemEntity.isDirectorySync(ArtifactStore.packageRoot)) {
String message = '${ArtifactStore.packageRoot} is not a valid directory.'; String message = '${ArtifactStore.packageRoot} is not a valid directory.';
if (ArtifactStore.packageRoot == 'packages') { if (ArtifactStore.packageRoot == 'packages') {
......
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