diff options
Diffstat (limited to 'StoneIsland/platforms/android/cordova/run')
| -rwxr-xr-x | StoneIsland/platforms/android/cordova/run | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/StoneIsland/platforms/android/cordova/run b/StoneIsland/platforms/android/cordova/run index 8c6fe38c..9544c1dc 100755 --- a/StoneIsland/platforms/android/cordova/run +++ b/StoneIsland/platforms/android/cordova/run @@ -19,19 +19,35 @@ under the License. */ -var run = require('./lib/run'), - reqs = require('./lib/check_reqs'), - args = process.argv; +var Api = require('./Api'); +var nopt = require('nopt'); +var path = require('path'); // Support basic help commands -if (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' || - args[2] == 'help' || args[2] == '-help' || args[2] == '/help') { - run.help(args); -} else { - reqs.run().done(function() { - return run.run(args); - }, function(err) { - console.error('ERROR: ' + err); - process.exit(2); - }); -} +if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) + require('./lib/run').help(); + +// Do some basic argument parsing +var runOpts = nopt({ + 'verbose' : Boolean, + 'silent' : Boolean, + 'debug' : Boolean, + 'release' : Boolean, + 'nobuild': Boolean, + 'buildConfig' : path, + 'archs' : String, + 'device' : Boolean, + 'emulator': Boolean, + 'target' : String +}, { 'd' : '--verbose' }); + +// Make runOptions compatible with PlatformApi run method spec +runOpts.argv = runOpts.argv.remain; + +require('./loggingHelper').adjustLoggerLevel(runOpts); + +new Api().run(runOpts) +.catch(function(err) { + console.error(err, err.stack); + process.exit(2); +}); |
