cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [05/14] cordova-paramedic git commit: verbose mode available
Date Sat, 05 Mar 2016 06:49:28 GMT
verbose mode available


Project: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/commit/32096dd9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/tree/32096dd9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/diff/32096dd9

Branch: refs/heads/master
Commit: 32096dd9bc9581f6607f7d1862a63657bd51f587
Parents: f18caec
Author: Tomasz Subik <tsubik@gmail.com>
Authored: Tue Jun 2 19:01:18 2015 +0200
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Mon Aug 24 11:10:40 2015 -0700

----------------------------------------------------------------------
 main.js      |  7 ++++---
 paramedic.js | 25 ++++++++++++++-----------
 2 files changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/32096dd9/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 03a1a20..80592a4 100755
--- a/main.js
+++ b/main.js
@@ -16,8 +16,9 @@ var USAGE = "Error missing args. \n" +
 	"`MSECS` : (optional) time in millisecs to wait for tests to pass|fail \n" +
 			  "\t(defaults to 10 minutes) \n" +
 	"`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";
 
 var argv = parseArgs(process.argv.slice(2));
 
@@ -37,5 +38,5 @@ var onComplete = function(resCode,resObj,logStr) {
 	process.exit(resCode);
 };
 
-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);
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/32096dd9/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index 9387a0e..09dcd85 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -14,7 +14,7 @@ var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a
param
 
 
 
-function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent)
{
+function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent,bVerbose)
{
     this.tunneledUrl = "";
     this.port = nPort;
     this.justBuild = bJustBuild;
@@ -23,6 +23,7 @@ function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeo
     this.callback = _callback;
     this.tempFolder = null;
     this.timeout = msTimeout;
+    this.verbose = bVerbose;
 
     if(browserify) {
         this.browserify = "--browserify";
@@ -45,7 +46,7 @@ function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeo
 
 ParamedicRunner.prototype = {
     run: function() {
-        var cordovaResult = shell.exec('cordova --version', {silent:true});
+        var cordovaResult = shell.exec('cordova --version', {silent:!this.verbose});
         if(cordovaResult.code) {
             this.logMessage(cordovaResult.output);
             // this would be fatal
@@ -67,13 +68,13 @@ ParamedicRunner.prototype = {
         this.tempFolder = tmp.dirSync();
         tmp.setGracefulCleanup();
         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);
     },
     installSinglePlugin: function(plugin) {
         this.logMessage("cordova-paramedic: installing " + plugin);
         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) {
             this.logMessage('Failed to install plugin : ' + plugin);
             this.cleanUpAndExitWithCode(1);
@@ -91,7 +92,7 @@ ParamedicRunner.prototype = {
         if(!this.justBuild) {
             this.logMessage("cordova-paramedic: installing plugin-test-framework");
             var plugAddCmd = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
-                                         {silent:true});
+                                         {silent:!this.verbose});
             if(plugAddCmd.code !== 0) {
                 this.logMessage('cordova-plugin-test-framework');
                 this.cleanUpAndExitWithCode(1);
@@ -220,12 +221,12 @@ ParamedicRunner.prototype = {
         var self = this;
         if(self.justBuild) {
             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){
                     if(code !== 0) {
                         self.logMessage("Error: cordova build returned error code " + code);
@@ -241,11 +242,11 @@ ParamedicRunner.prototype = {
         else {
             self.setConfigStartPage();
             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){
                     if(code !== 0) {
                         self.logMessage("Error: cordova emulate return error code " + code);
@@ -273,6 +274,7 @@ ParamedicRunner.prototype = {
 };
 
 var storedCWD =  null;
+
 exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bBrowserify,bSilent,bVerbose)
{
 
     storedCWD = storedCWD || process.cwd();
@@ -289,6 +291,7 @@ exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout
 
         var runner = new ParamedicRunner(_platformId, plugins, callback, !!bJustBuild,
                                          nPort || PORT, msTimeout || TIMEOUT, !!bBrowserify,
!!bSilent, !!bVerbose);
+
         runner.storedCWD = storedCWD;
         return runner.run();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message