Prepend mojo shebang to skyx files

skyx files are zips, so they can have anything at the start. Having
a shebang line at the start makes it easier to run skyx files in a mojo
environment.
This commit is contained in:
James Robinson
2015-09-17 15:27:30 -07:00
parent 3e9ceec0b1
commit 0b2a946b23

View File

@@ -174,7 +174,8 @@ class BuildCommandHandler extends CommandHandler {
}
File outputFile = new File(results['output-file']);
await outputFile.writeAsBytes(new ZipEncoder().encode(archive));
await outputFile.writeAsString('#!mojo mojo:sky_viewer\n')
await outputFile.writeAsBytes(new ZipEncoder().encode(archive), mode: FileMode.APPEND);
return 0;
}
}