cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/4] git commit: Wait for the pre_package event to finish, or the update_csproj function might give unexpected results. Fixes both the wp7 and wp8 parser.
Date Mon, 04 Nov 2013 19:53:01 GMT
Wait for the pre_package event to finish, or the update_csproj function might give unexpected
results.
Fixes both the wp7 and wp8 parser.


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/60139a64
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/60139a64
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/60139a64

Branch: refs/heads/master
Commit: 60139a64a5f692c53c964a391f29f81a723726f8
Parents: 11a081c
Author: DvdBrink <d_vandenbrink@live.com>
Authored: Tue Sep 24 23:06:33 2013 +0200
Committer: DvdBrink <d_vandenbrink@live.com>
Committed: Tue Sep 24 23:06:33 2013 +0200

----------------------------------------------------------------------
 src/metadata/wp7_parser.js | 18 ++++++++++++------
 src/metadata/wp8_parser.js | 17 +++++++++++------
 2 files changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/60139a64/src/metadata/wp7_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp7_parser.js b/src/metadata/wp7_parser.js
index cb60d9c..856e1cf 100644
--- a/src/metadata/wp7_parser.js
+++ b/src/metadata/wp7_parser.js
@@ -254,13 +254,19 @@ module.exports.prototype = {
         this.update_www();
 
         // trigger an event in case anyone needs to modify the contents of the www folder
before we package it.
+        var deferred = Q.defer();
+        var that = this;
         var projectRoot = util.isCordova(process.cwd());
         var hooks = new hooker(projectRoot);
-        hooks.fire('pre_package', { wwwPath:this.www_dir() }, function(err) { });
-        this.update_csproj();
-        // TODO: Add overrides support? Why is this missing?
-        this.update_staging();
-        util.deleteSvnFolders(this.www_dir());
-        return Q();
+        hooks.fire('pre_package', { wwwPath:this.www_dir() }, function(err) { })
+            .then(function() {
+                that.update_csproj();
+                // TODO: Add overrides support? Why is this missing?
+                that.update_staging();
+                util.deleteSvnFolders(that.www_dir());
+                deferred.resolve();
+            });
+
+        return deferred.promise;
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/60139a64/src/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp8_parser.js b/src/metadata/wp8_parser.js
index 881216e..b785ad4 100644
--- a/src/metadata/wp8_parser.js
+++ b/src/metadata/wp8_parser.js
@@ -257,13 +257,18 @@ module.exports.prototype = {
         this.update_www();
         
          // trigger an event in case anyone needs to modify the contents of the www folder
before we package it.
+        var deferred = Q.defer();
+        var that = this;
         var projectRoot = util.isCordova(process.cwd());
         var hooks = new hooker(projectRoot);
-        hooks.fire('pre_package', { wwwPath:this.www_dir() }, function(err) { });
-        this.update_csproj();
-        
-        this.update_staging();
-        util.deleteSvnFolders(this.www_dir());
-        return Q();
+        hooks.fire('pre_package', { wwwPath:this.www_dir() }, function(err) { })
+            .then(function() {
+                that.update_csproj();
+                that.update_staging();
+                util.deleteSvnFolders(that.www_dir());
+                deferred.resolve();
+            });
+
+        return deferred.promise;
     }
 };


Mime
View raw message