cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kam...@apache.org
Subject git commit: Check for a CORDOVA_HOME environment variable to create the global config path
Date Sat, 11 Oct 2014 12:03:45 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 0c325ef13 -> 925009d76


Check for a CORDOVA_HOME environment variable to create the global config path

github: close #104


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/925009d7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/925009d7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/925009d7

Branch: refs/heads/master
Commit: 925009d76125a7815f6dda6f4980f724b8d9b325
Parents: 0c325ef
Author: System Administrator <root@URRUTAL.local>
Authored: Sat Oct 11 12:23:41 2014 +0200
Committer: Mark Koudritsky <kamrik@gmail.com>
Committed: Sat Oct 11 08:02:50 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/cordova/util.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/925009d7/cordova-lib/src/cordova/util.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/util.js b/cordova-lib/src/cordova/util.js
index 89b0ef3..5992ab9 100644
--- a/cordova-lib/src/cordova/util.js
+++ b/cordova-lib/src/cordova/util.js
@@ -18,7 +18,7 @@
 */
 
 /* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
-          indent:4, unused:vars, latedef:nofunc
+          indent:4, unused:vars, latedef:nofunc, sub:true
 */
 
 var fs            = require('fs'),
@@ -27,8 +27,12 @@ var fs            = require('fs'),
     shell         = require('shelljs');
 
 // Global configuration paths
-var HOME = process.env[(process.platform.slice(0, 3) == 'win') ? 'USERPROFILE' : 'HOME'];
-var global_config_path = path.join(HOME, '.cordova');
+var global_config_path = process.env['CORDOVA_HOME'];
+if (!global_config_path) {
+	var HOME = process.env[(process.platform.slice(0, 3) == 'win') ? 'USERPROFILE' : 'HOME'];
+    global_config_path = path.join(HOME, '.cordova');
+}
+
 var lib_path = path.join(global_config_path, 'lib');
 shell.mkdir('-p', lib_path);
 


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


Mime
View raw message