cordova-paramedic
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -19,4 +19,5 @@ #!/usr/bin/env node | ||
"`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server\n" + | ||
"--justbuild : (optional) just builds the project, without running the tests \n" + | ||
"--browserify : (optional) plugins are browserified into cordova.js"; | ||
"--justbuild : (optional) just builds the project, without running the tests \n" + | ||
"--browserify : (optional) plugins are browserified into cordova.js \n" + | ||
"--verbose : (optional) verbose mode. Display more information output"; | ||
@@ -41,3 +42,3 @@ var argv = parseArgs(process.argv.slice(2)); | ||
paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout, argv.browserify, false); | ||
paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout, argv.browserify, false, argv.verbose); | ||
{ | ||
"name": "cordova-paramedic", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Use medic to test a cordova plugin locally", | ||
@@ -5,0 +5,0 @@ "main": "paramedic.js", |
@@ -17,3 +17,3 @@ #!/usr/bin/env node | ||
function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent) { | ||
function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent,bVerbose) { | ||
this.tunneledUrl = ""; | ||
@@ -27,2 +27,3 @@ this.port = nPort; | ||
this.timeout = msTimeout; | ||
this.verbose = bVerbose; | ||
@@ -50,3 +51,3 @@ if(browserify) { | ||
run: function() { | ||
var cordovaResult = shell.exec('cordova --version', {silent:true}); | ||
var cordovaResult = shell.exec('cordova --version', {silent:!this.verbose}); | ||
if(cordovaResult.code) { | ||
@@ -73,3 +74,3 @@ this.logMessage(cordovaResult.output); | ||
this.logMessage("cordova-paramedic: creating temp project at " + this.tempFolder.name); | ||
shell.exec('cordova create ' + this.tempFolder.name,{silent:true}); | ||
shell.exec('cordova create ' + this.tempFolder.name,{silent:!this.verbose}); | ||
shell.cd(this.tempFolder.name); | ||
@@ -80,3 +81,3 @@ }, | ||
var pluginPath = path.resolve(this.storedCWD, plugin); | ||
var plugAddCmd = shell.exec('cordova plugin add ' + pluginPath, {silent:true}); | ||
var plugAddCmd = shell.exec('cordova plugin add ' + pluginPath, {silent:!this.verbose}); | ||
if(plugAddCmd.code !== 0) { | ||
@@ -99,3 +100,3 @@ this.logMessage('Failed to install plugin : ' + plugin); | ||
var plugAddCmd = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework', | ||
{silent:true}); | ||
{silent:!this.verbose}); | ||
if(plugAddCmd.code !== 0) { | ||
@@ -229,8 +230,8 @@ this.logMessage('cordova-plugin-test-framework'); | ||
self.logMessage("cordova-paramedic: adding platform"); | ||
shell.exec('cordova platform add ' + self.platformId,{silent:true}); | ||
shell.exec('cordova prepare '+ self.browserify,{silent:true}); | ||
shell.exec('cordova platform add ' + self.platformId,{silent:!this.verbose}); | ||
shell.exec('cordova prepare '+ self.browserify,{silent:!this.verbose}); | ||
self.logMessage("building ..."); | ||
shell.exec('cordova build ' + self.platformId.split("@")[0], | ||
{async:true,silent:true}, | ||
{async:true,silent:!this.verbose}, | ||
function(code,output){ | ||
@@ -251,7 +252,7 @@ if(code !== 0) { | ||
self.logMessage("cordova-paramedic: adding platform"); | ||
shell.exec('cordova platform add ' + self.platformId,{silent:true}); | ||
shell.exec('cordova prepare '+ self.browserify,{silent:true}); | ||
shell.exec('cordova platform add ' + self.platformId,{silent:!this.verbose}); | ||
shell.exec('cordova prepare '+ self.browserify,{silent:!this.verbose}); | ||
shell.exec('cordova emulate ' + self.platformId.split("@")[0] + " --phone", | ||
{async:true,silent:true}, | ||
{async:true,silent:!this.verbose}, | ||
function(code,output){ | ||
@@ -284,4 +285,5 @@ if(code !== 0) { | ||
var storedCWD = null; | ||
exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bSilent) { | ||
exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bBrowserify,bSilent,bVerbose) { | ||
storedCWD = storedCWD || process.cwd(); | ||
@@ -300,3 +302,4 @@ if(_platformId && _plugins) { | ||
var runner = new ParamedicRunner(_platformId, plugins, callback, !!bJustBuild, | ||
nPort || PORT, msTimeout || TIMEOUT, !!bSilent); | ||
nPort || PORT, msTimeout || TIMEOUT, !!bBrowserify, !!bSilent, !!bVerbose); | ||
runner.storedCWD = storedCWD; | ||
@@ -303,0 +306,0 @@ return runner.run(); |
@@ -0,0 +0,0 @@ cordova-paramedic |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
364
31263