You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/11/01 02:26:26 UTC

[5/6] git commit: CB-7904 incorporated feedback from comments on PR

CB-7904 incorporated feedback from comments on PR


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/32d74c65
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/32d74c65
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/32d74c65

Branch: refs/heads/master
Commit: 32d74c651fd300a0d78cf2e4e2ab77d1127f0cba
Parents: 304e054
Author: Steve Gill <st...@gmail.com>
Authored: Thu Oct 30 15:55:05 2014 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Oct 31 18:25:00 2014 -0700

----------------------------------------------------------------------
 src/gitutil.js  |  4 ++++
 src/nightly.js  | 29 +++++++++++++----------------
 src/repoutil.js |  7 +++----
 3 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/32d74c65/src/gitutil.js
----------------------------------------------------------------------
diff --git a/src/gitutil.js b/src/gitutil.js
index 907292f..3296b62 100644
--- a/src/gitutil.js
+++ b/src/gitutil.js
@@ -93,3 +93,7 @@ exports.hashForRef = function(ref) {
 exports.resetFromOrigin = function() {
     return executil.execHelper(executil.ARGS('git reset --hard origin/master'), false, true);
 }
+
+exports.gitClean = function() {
+    return executil.execHelper(executil.ARGS('git clean -d -f'), false, true);
+}

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/32d74c65/src/nightly.js
----------------------------------------------------------------------
diff --git a/src/nightly.js b/src/nightly.js
index 3de5f10..45ec1a2 100644
--- a/src/nightly.js
+++ b/src/nightly.js
@@ -53,20 +53,21 @@ module.exports = function*(argv) {
 
     //Update Repos
     yield repoupdate.updateRepos(repos);
-    
-    //Remove any local changes for cli & lib
-    yield repoutil.forEachRepo([cordovaLib, cli], function*() {
-        gitutil.resetFromOrigin();
-    });
-    
+
+    //remove local changes and sync up with remote master
+    yield repoutil.forEachRepo(repos, function*() {
+        yield gitutil.gitClean();
+        yield gitutil.resetFromOrigin();
+    })
+        
     //get SHAS from platforms
     var SHAJSON = yield retrieveSha(repos);
     
     //save SHAJSON in cordova-cli repo
     yield repoutil.forEachRepo([cli], function*() {
         //need to get the path to cordova-cli using executil
-        var cordovaclidir = yield executil.execHelper(executil.ARGS('pwd'), true, true);
-        fs.writeFile((path.join(cordovaclidir, 'shas.json')), JSON.stringify(SHAJSON, null, 4), 'utf8', function(err) {
+        var cordovaclidir = process.cwd(); 
+        fs.writeFileSync((path.join(cordovaclidir, 'shas.json')), JSON.stringify(SHAJSON, null, 4), 'utf8', function(err) {
             if (err) return console.log (err);
         });
 
@@ -76,7 +77,7 @@ module.exports = function*(argv) {
     var cordovalibdir;
     yield repoutil.forEachRepo([cordovaLib], function*() {
         //need to get the path to cordova-lib using executil
-        cordovalibdir = yield executil.execHelper(executil.ARGS('pwd'), true, true);
+        cordovalibdir = process.cwd(); 
     });
 
     yield updatePlatformsFile(path.join(cordovalibdir, 'src/cordova/platformsConfig.json'), SHAJSON);
@@ -88,7 +89,7 @@ module.exports = function*(argv) {
     var cordovaLibVersion;
     //update package.json version for cli + lib, update lib reference for cli
     yield repoutil.forEachRepo([cordovaLib, cli], function*(repo) {
-        var dir = yield executil.execHelper(executil.ARGS('pwd'), true, true);
+        var dir = process.cwd(); 
         var packageJSON = require(dir+'/package.json');
         packageJSON.version = versionutil.removeDev(packageJSON.version) + nightlyVersion;
 
@@ -98,7 +99,7 @@ module.exports = function*(argv) {
             packageJSON.dependencies['cordova-lib'] = cordovaLibVersion;
         }
 
-        fs.writeFile(dir+'/package.json', JSON.stringify(packageJSON, null, 4), 'utf8', function(err) {
+        fs.writeFileSync(dir+'/package.json', JSON.stringify(packageJSON, null, 4), 'utf8', function(err) {
             if (err) return console.log (err);
         });
     });
@@ -132,17 +133,13 @@ function *updatePlatformsFile(file, shajson) {
         }
     });
 
-    fs.writeFile(file, JSON.stringify(platformsJS, null, 4), 'utf8', function(err) {
+    fs.writeFileSync(file, JSON.stringify(platformsJS, null, 4), 'utf8', function(err) {
         if (err) return console.log (err);
     });
 }
 
 function *runTests(cli, lib) {
     yield repoutil.forEachRepo([cli, lib], function *(repo) {
-        if (repo.id === 'lib'){
            yield executil.execHelper(executil.ARGS('npm test'), false, false);
-        } else {
-           yield executil.execHelper(executil.ARGS('npm test'), false, false);
-        }
     });
 }

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/32d74c65/src/repoutil.js
----------------------------------------------------------------------
diff --git a/src/repoutil.js b/src/repoutil.js
index b08cb5a..69ef3d2 100644
--- a/src/repoutil.js
+++ b/src/repoutil.js
@@ -451,8 +451,10 @@ exports.forEachRepo = function*(repos, func) {
 
         isInForEachRepoFunction = true;
         
+        //cordova-lib lives inside of a top level cordova-lib directory
         if(repo.id === 'lib'){
-            newPath = newPath + '/cordova-lib'
+            newPath = newPath + '/cordova-lib';
+            origPath = origPath + '/..';
         } 
         shelljs.cd(newPath);
 
@@ -461,9 +463,6 @@ exports.forEachRepo = function*(repos, func) {
         }
         yield func(repo);
         
-        if(repo.id === 'lib'){
-            origPath = origPath + '/..';
-        }
         shelljs.cd(origPath);
 
         isInForEachRepoFunction = !((origPath === '..')||(origPath === '../..'));


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