Commit 902ffa12 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Set `Cache.flutterRoot` after replay environment is set up. (#8614)

Fixes #8562
parent 582df7b6
......@@ -83,8 +83,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
hide: !verboseHelp,
help: 'Path to your ".packages" file.$packagesHelp');
argParser.addOption('flutter-root',
help: 'The root directory of the Flutter repository (uses \$$kFlutterRootEnvironmentVariableName if set).',
defaultsTo: _defaultFlutterRoot);
help: 'The root directory of the Flutter repository (uses \$$kFlutterRootEnvironmentVariableName if set).');
if (verboseHelp)
argParser.addSeparator('Local build selection options (not normally required):');
......@@ -226,8 +225,9 @@ class FlutterCommandRunner extends CommandRunner<Null> {
logger.supportsColor = globalResults['color'];
// We must set Cache.flutterRoot early because other features use it (e.g.
// enginePath's initialiser uses it).
Cache.flutterRoot = fs.path.normalize(fs.path.absolute(globalResults['flutter-root']));
// enginePath's initializer uses it).
final String flutterRoot = globalResults['flutter-root'] ?? _defaultFlutterRoot;
Cache.flutterRoot = fs.path.normalize(fs.path.absolute(flutterRoot));
if (platform.environment['FLUTTER_ALREADY_LOCKED'] != 'true')
await Cache.lock();
......
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