cordova-paramedic
Advanced tools
Comparing version 0.1.0 to 0.2.0
14
main.js
@@ -10,3 +10,7 @@ #!/usr/bin/env node | ||
var USAGE = "Error missing args. \n Usage: $cordova-paramedic " + | ||
" --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]"; | ||
" --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild ] [--port PORT] [--timeout TIMEOUT] \n" + | ||
" CORDOVA-PLATFORM : Which platform to build target\n" + | ||
" PLUGIN-PATH : Path to the plugin to install.\n" + | ||
" --justbuild : Will not run tests, just verify that the plugin+platform can be built.\n" + | ||
" TIMEOUT : time to wait for tests to run, in msecs, default is 10 minutes."; | ||
@@ -24,7 +28,9 @@ var argv = parseArgs(process.argv.slice(2)); | ||
var onComplete = function(resCode,resObj) { | ||
console.log("result is : " + resCode + "\n" + JSON.stringify(resObj)); | ||
process.exit(resCode); | ||
} | ||
paramedic.run(platformId,plugins,argv.justbuild,argv.port,argv.timeout); | ||
paramedic.run(platformId, plugins, onComplete, argv.justbuild, argv.port, argv.timeout); | ||
{ | ||
"name": "cordova-paramedic", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Use medic to test a cordova plugin locally", | ||
@@ -5,0 +5,0 @@ "main": "paramedic.js", |
@@ -22,6 +22,7 @@ #!/usr/bin/env node | ||
var plugins, | ||
platformId; | ||
platformId, | ||
callback; | ||
exports.run = function(_platformId,_plugins,bJustBuild,nPort,msTimeout) { | ||
exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout) { | ||
@@ -34,2 +35,8 @@ if(_platformId && _plugins) { | ||
// if we are passed a callback, we will use it, | ||
// otherwise just make a quick and dirty one | ||
callback = ( _callback && _callback.apply ) ? _callback : function(resCode,resObj) { | ||
process.exit(resCode); | ||
}; | ||
JustBuild = bJustBuild == true; | ||
@@ -151,3 +158,3 @@ PORT = nPort || PORT; | ||
function cleanUpAndExitWithCode(exitCode) { | ||
function cleanUpAndExitWithCode(exitCode,resultsObj) { | ||
shell.cd(storedCWD); | ||
@@ -157,3 +164,3 @@ // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here | ||
process.exit(exitCode); | ||
callback(exitCode,resultsObj); | ||
} | ||
@@ -249,6 +256,6 @@ | ||
if(results.mobilespec.failures > 0) { | ||
cleanUpAndExitWithCode(1); | ||
cleanUpAndExitWithCode(1,results); | ||
} | ||
else { | ||
cleanUpAndExitWithCode(0); | ||
cleanUpAndExitWithCode(0,results); | ||
} | ||
@@ -255,0 +262,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
32580
324
1