Adds a run_mojo command that downloads sky_viewer.mojo and runs an flx in it

This initial version assumes the developer has mojo_shell and all other services
sitting on disk somewhere and that they're on linux and only want to run on
linux. This can be generalized down the line to support more use cases. This
downloads the sky_viewer.mojo corresponding to the packages/sky_engine/REVISION
in the developer's directory, so they can specify whatever revision they want.
sky_tools run_mojo downloads sky_viewer.mojo into its cache directory if it is
not present and constructs a command line to pass to mojo_shell that maps the
shebang stamped into the flx to the downloaded sky_viewer.mojo.

Since sky_viewer.mojo lives in the cloud and mojo_shell can load from the cloud
this could also map to an https URL. This should likely be an option.
This commit is contained in:
James Robinson
2015-09-18 11:10:48 -07:00
parent 88a5cf95d2
commit 542da8ccd5
3 changed files with 104 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ import 'package:sky_tools/src/build.dart';
import 'package:sky_tools/src/common.dart';
import 'package:sky_tools/src/init.dart';
import 'package:sky_tools/src/install.dart';
import 'package:sky_tools/src/run_mojo.dart';
void main(List<String> args) {
Logger.root.level = Level.WARNING;
@@ -43,6 +44,7 @@ void main(List<String> args) {
new BuildCommandHandler(),
new InitCommandHandler(),
new InstallCommandHandler(),
new RunMojoCommandHandler(),
]) {
parser.addCommand(handler.name, handler.parser);
handlers[handler.name] = handler;