rollo
Version:
The Rollo programming language for the Orbotix Sphero robot using Node.js and Cylon.js
28 lines (21 loc) • 678 B
JavaScript
/**
* Created with IntelliJ IDEA.
* User: mfo
* Date: 5/7/15
* Time: 7:48 PM
*/
// var Rollo = require('rollo'); // use this if you want to call the Rollo from node_modules
var Rollo = require('../lib');
module.exports.main = function(my) {
if (process.argv.length < 3) {
console.log('Usage: node ' + process.argv[1].substr(process.argv[1].lastIndexOf('/')+1) + ' filename.rol');
console.log('\nYou must specify the name of the Rollo script file.\n');
process.exit(1);
}
Rollo.setDebug(true);
var fileName = process.argv[2];
Rollo.runFile(my.sphero, fileName, function () {
console.log("ROLLO: Shutting down");
process.exit(0);
});
};