Commit 35e30235 authored by Alhaad Gokhale's avatar Alhaad Gokhale

In run_mojo command, parse Uri scheme to decide whether app is on local

filesystem or not.
parent c4da1da2
......@@ -109,19 +109,18 @@ class RunMojoCommand extends FlutterCommand {
args.add('--android');
}
try {
final Uri appUri = Uri.parse(bundlePath);
if (appUri.scheme.isEmpty || appUri.scheme == 'file') {
final String appPath = _makePathAbsolute(bundlePath);
if (argResults['android']) {
final String appName = path.basename(appPath);
final String appDir = path.dirname(appPath);
args.add('mojo:launcher http://app/$appName');
args.add('--map-origin=http://app/=$appDir');
final String appName = path.basename(appPath);
final String appDir = path.dirname(appPath);
args.add('mojo:launcher http://app/$appName');
args.add('--map-origin=http://app/=$appDir');
} else {
args.add('mojo:launcher file://$appPath');
}
} catch(_) {
// This means that |bundlePath| is not on the file-system, so let us treat
// it as a URL.
} else {
args.add('mojo:launcher $bundlePath');
}
......
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