Commit 58edc7ed authored by Alhaad Gokhale's avatar Alhaad Gokhale

In run_mojo, rename bundlePath -> targetApp since it may not be a path.

parent 35e30235
...@@ -86,7 +86,7 @@ class RunMojoCommand extends FlutterCommand { ...@@ -86,7 +86,7 @@ class RunMojoCommand extends FlutterCommand {
return result; return result;
} }
Future<List<String>> _getShellConfig(String bundlePath) async { Future<List<String>> _getShellConfig(String targetApp) async {
List<String> args = <String>[]; List<String> args = <String>[];
final bool useDevtools = _useDevtools(); final bool useDevtools = _useDevtools();
...@@ -109,9 +109,9 @@ class RunMojoCommand extends FlutterCommand { ...@@ -109,9 +109,9 @@ class RunMojoCommand extends FlutterCommand {
args.add('--android'); args.add('--android');
} }
final Uri appUri = Uri.parse(bundlePath); final Uri appUri = Uri.parse(targetApp);
if (appUri.scheme.isEmpty || appUri.scheme == 'file') { if (appUri.scheme.isEmpty || appUri.scheme == 'file') {
final String appPath = _makePathAbsolute(bundlePath); final String appPath = _makePathAbsolute(targetApp);
if (argResults['android']) { if (argResults['android']) {
final String appName = path.basename(appPath); final String appName = path.basename(appPath);
final String appDir = path.dirname(appPath); final String appDir = path.dirname(appPath);
...@@ -121,7 +121,7 @@ class RunMojoCommand extends FlutterCommand { ...@@ -121,7 +121,7 @@ class RunMojoCommand extends FlutterCommand {
args.add('mojo:launcher file://$appPath'); args.add('mojo:launcher file://$appPath');
} }
} else { } else {
args.add('mojo:launcher $bundlePath'); args.add('mojo:launcher $targetApp');
} }
// Add url-mapping for mojo:flutter. // Add url-mapping for mojo:flutter.
...@@ -164,21 +164,21 @@ class RunMojoCommand extends FlutterCommand { ...@@ -164,21 +164,21 @@ class RunMojoCommand extends FlutterCommand {
await downloadToolchain(); await downloadToolchain();
String bundlePath = argResults['app']; String targetApp = argResults['app'];
if (bundlePath == null) { if (targetApp == null) {
bundlePath = _kDefaultBundlePath; targetApp = _kDefaultBundlePath;
String mainPath = findMainDartFile(argResults['target']); String mainPath = findMainDartFile(argResults['target']);
int result = await flx.build( int result = await flx.build(
toolchain, toolchain,
mainPath: mainPath, mainPath: mainPath,
outputPath: bundlePath outputPath: targetApp
); );
if (result != 0) if (result != 0)
return result; return result;
} }
return await runCommandAndStreamOutput(await _getShellConfig(bundlePath)); return await runCommandAndStreamOutput(await _getShellConfig(targetApp));
} }
} }
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