Commit b645e4ea authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[fuchsia_reload] Fix command line argument checking (#9434)

parent fc58bd76
...@@ -195,9 +195,12 @@ class FuchsiaReloadCommand extends FlutterCommand { ...@@ -195,9 +195,12 @@ class FuchsiaReloadCommand extends FlutterCommand {
return; return;
} }
final List<String> gnTarget = _extractPathAndName(argResults['gn-target']); final String gnTarget = argResults['gn-target'];
_projectRoot = gnTarget[0]; if (gnTarget == null)
_projectName = gnTarget[1]; throwToolExit('Give the GN target with --gn-target(-g).');
final List<String> targetInfo = _extractPathAndName(gnTarget);
_projectRoot = targetInfo[0];
_projectName = targetInfo[1];
_fuchsiaProjectPath = '$_fuchsiaRoot/$_projectRoot'; _fuchsiaProjectPath = '$_fuchsiaRoot/$_projectRoot';
if (!_directoryExists(_fuchsiaProjectPath)) if (!_directoryExists(_fuchsiaProjectPath))
throwToolExit('Target does not exist in the Fuchsia tree: $_fuchsiaProjectPath.'); throwToolExit('Target does not exist in the Fuchsia tree: $_fuchsiaProjectPath.');
......
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