cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject [2/3] cordova-browser git commit: CB-7978 Cleaning code and creating temporary dir - Cleaning code - Declaring variables only when needed - Creating chrome for Cordova temp dir prior using it by std and err
Date Tue, 25 Nov 2014 02:29:33 GMT
CB-7978 Cleaning code and creating temporary dir
- Cleaning code
- Declaring variables only when needed
- Creating chrome for Cordova temp dir prior using it by std and err


Project: http://git-wip-us.apache.org/repos/asf/cordova-browser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-browser/commit/8f865097
Tree: http://git-wip-us.apache.org/repos/asf/cordova-browser/tree/8f865097
Diff: http://git-wip-us.apache.org/repos/asf/cordova-browser/diff/8f865097

Branch: refs/heads/master
Commit: 8f8650977fc8504892c5e72cd6e5820de2151801
Parents: 87e19e2
Author: Victor Sosa <sosah.victor@gmail.com>
Authored: Fri Nov 7 12:23:30 2014 -0600
Committer: Victor Sosa <sosah.victor@gmail.com>
Committed: Fri Nov 7 12:23:30 2014 -0600

----------------------------------------------------------------------
 bin/templates/project/cordova/run | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/8f865097/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/run b/bin/templates/project/cordova/run
index ce57846..9f9ccaf 100755
--- a/bin/templates/project/cordova/run
+++ b/bin/templates/project/cordova/run
@@ -27,10 +27,9 @@ var configXML = fs.readFileSync(configFile, 'utf8');
 var sourceFile = /<content[\s\S]*?src\s*=\s*"(.*?)"/i.exec(configXML);	
 var spawn = require('child_process').spawn,
     tmpDir = '/tmp/temp_chrome_user_data_dir_for_cordova_browser/',
-    out = fs.openSync(tmpDir + 'out.log', 'a'),
-    err = fs.openSync(tmpDir + 'out.log', 'a'),
     project = 'file://' + shell.pwd() + '/platforms/browser/www/' + sourceFile[1];
 
+fs.mkdir(tmpDir);
 switch (process.platform) {
   case 'linux':
   	var args = ['--disable-web-security', '--user-data-dir=/tmp/temp_chrome_user_data_dir_for_cordova_browser',
project];
@@ -38,8 +37,10 @@ switch (process.platform) {
   	
   	chromeProcess.on('close', function(code) {
   		if (code != 0) {
-  			var options = {detached: true, stdio: ['ignore', out, err]};
-  			var chromeProcess = spawn('google-chrome', args, options);
+			var out = fs.openSync(tmpDir + 'out.log', 'a'),
+    			    err = fs.openSync(tmpDir + 'out.log', 'a'),
+  			    options = {detached: true, stdio: ['ignore', out, err]},
+  			    chromeProcess = spawn('google-chrome', args, options);
   			chromeProcess.unref();
   			
   		}


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


Mime
View raw message