cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [44/50] git commit: Adding staging dir support to WP7+8.
Date Thu, 23 May 2013 21:58:41 GMT
Adding staging dir support to WP7+8.


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

Branch: refs/heads/master2
Commit: 0584e1794744c5c65f6d1d5ad09797834d025782
Parents: a79365d
Author: Braden Shepherdson <braden.shepherdson@gmail.com>
Authored: Thu May 23 16:38:31 2013 -0400
Committer: Braden Shepherdson <braden.shepherdson@gmail.com>
Committed: Thu May 23 16:38:31 2013 -0400

----------------------------------------------------------------------
 src/metadata/wp7_parser.js |   15 +++++++++++++++
 src/metadata/wp8_parser.js |   15 +++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0584e179/src/metadata/wp7_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp7_parser.js b/src/metadata/wp7_parser.js
index 289eca0..3a4244f 100644
--- a/src/metadata/wp7_parser.js
+++ b/src/metadata/wp7_parser.js
@@ -144,12 +144,27 @@ module.exports.prototype = {
         var cordovajs_path = path.join(util.libDirectory, 'cordova-wp7', 'templates', 'standalone',
'www', 'cordova-' + VERSION + '.js');
         fs.writeFileSync(path.join(this.www_dir(), 'cordova.js'), fs.readFileSync(cordovajs_path,
'utf-8'), 'utf-8');
     },
+
+    staging_dir: function() {
+        return path.join(this.path, '.staging', 'www');
+    },
+
+    update_staging: function() {
+        var projectRoot = util.isCordova(this.path);
+        if (fs.existsSync(this.staging_dir())) {
+            var staging = path.join(this.staging_dir(), '*');
+            shell.cp('-rf', staging, this.www_dir());
+        }
+    },
+
     // calls the nessesary functions to update the wp7 project 
     update_project:function(cfg, callback) {
         //console.log("Updating wp7 project...");
 
         this.update_from_config(cfg);
         this.update_www();
+        // TODO: Add overrides support? Why is this missing?
+        this.update_staging();
         util.deleteSvnFolders(this.www_dir());
 
         //console.log("Done updating.");

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0584e179/src/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp8_parser.js b/src/metadata/wp8_parser.js
index 5ecb6dc..ddfccea 100644
--- a/src/metadata/wp8_parser.js
+++ b/src/metadata/wp8_parser.js
@@ -142,12 +142,27 @@ module.exports.prototype = {
         var cordovajs_path = path.join(util.libDirectory, 'cordova-wp8', 'templates', 'standalone',
'www', 'cordova-' + VERSION + '.js');
         fs.writeFileSync(path.join(this.www_dir(), 'cordova.js'), fs.readFileSync(cordovajs_path,
'utf-8'), 'utf-8');
     },
+
+    staging_dir: function() {
+        return path.join(this.path, '.staging', 'www');
+    },
+
+    update_staging: function() {
+        var projectRoot = util.isCordova(this.path);
+        if (fs.existsSync(this.staging_dir())) {
+            var staging = path.join(this.staging_dir(), '*');
+            shell.cp('-rf', staging, this.www_dir());
+        }
+    },
+
     // calls the nessesary functions to update the wp8 project 
     update_project:function(cfg, callback) {
         //console.log("Updating wp8 project...");
 
         this.update_from_config(cfg);
         this.update_www();
+        // TODO: Add overrides support? Why is this missing?
+        this.update_staging();
         util.deleteSvnFolders(this.www_dir());
 
         //console.log("Done updating.");


Mime
View raw message