cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/4] js commit: CB-9156 platform version grabbing supports custom paths
Date Sat, 20 Jun 2015 01:09:06 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/CB-9156 [created] d0dcf9e3a


CB-9156 platform version grabbing supports custom paths


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/983e4fcb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/983e4fcb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/983e4fcb

Branch: refs/heads/CB-9156
Commit: 983e4fcb153982c7f021d9e0178e9ccacc951265
Parents: e021fcc
Author: Steve Gill <stevengill97@gmail.com>
Authored: Wed Jun 10 20:26:25 2015 -0700
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Fri Jun 19 15:49:06 2015 -0700

----------------------------------------------------------------------
 tasks/compile.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/983e4fcb/tasks/compile.js
----------------------------------------------------------------------
diff --git a/tasks/compile.js b/tasks/compile.js
index c86a62d..9cd5e24 100644
--- a/tasks/compile.js
+++ b/tasks/compile.js
@@ -41,13 +41,18 @@ module.exports = function(grunt) {
             if (flag.indexOf(platformName) > -1) {
                 var equalIndex = flag.indexOf('=');
                 platformPath = flag.slice(equalIndex + 1);
-                console.log(platformPath);
             }
         });
         if(!platformVersion) {
+            var platformPkgJson;
+            //grab platformVersion from custom path
+            if(platformPath && fs.existsSync(platformPath)) {
+                platformPkgJson = require('../' + platformPath + '/package.json');
+                platformVersion = platformPkgJson.version;
+
             //grab platformVersion from sibling platform directoreis
-            if(pkgJson['cordova-platforms']['cordova-'+platformName] && fs.existsSync(path.join(pkgJson['cordova-platforms']['cordova-'+platformName])))
{
-                var platformPkgJson = require('../' + pkgJson['cordova-platforms']['cordova-'+platformName]+'/package.json');
+            } else if(pkgJson['cordova-platforms']['cordova-'+platformName] && fs.existsSync(path.join(pkgJson['cordova-platforms']['cordova-'+platformName])))
{
+                platformPkgJson = require('../' + pkgJson['cordova-platforms']['cordova-'+platformName]+'/package.json');
                 platformVersion = platformPkgJson.version;
             } else {
                 platformVersion="N/A";


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


Mime
View raw message