Repository: cordova-coho
Updated Branches:
  refs/heads/plugins-releaser b1e777f9a -> 181b249be


dont use xml2js xml writer as we lose comments. instead, use sed to rewrite the 
plugin.xml versions.


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

Branch: refs/heads/plugins-releaser
Commit: 181b249be06d84d579a773d3a88d000d35339583
Parents: b1e777f
Author: filmaj <[email protected]>
Authored: Wed Mar 1 15:46:55 2017 -0800
Committer: filmaj <[email protected]>
Committed: Wed Mar 1 15:46:55 2017 -0800

----------------------------------------------------------------------
 src/versionutil.js | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/181b249b/src/versionutil.js
----------------------------------------------------------------------
diff --git a/src/versionutil.js b/src/versionutil.js
index 498c3ff..db1fa76 100644
--- a/src/versionutil.js
+++ b/src/versionutil.js
@@ -148,11 +148,8 @@ exports.updateRepoVersion = function 
*updateRepoVersion(repo, version, opts) {
                     if (err) throw err;
                     xml2js.parseString(data, function(err, xml) {
                         if (err) throw err;
-                        xml.plugin['$'].version = version;
-                        // TODO: writing out the xml in this way causes us to 
lose the comments, which means we lose the apache license header :(
-                        var xmlWriter = new xml2js.Builder();
-                        var xmlOutput = xmlWriter.buildObject(xml);
-                        fs.writeFileSync(xmlFile, xmlOutput + '\n');
+                        var prev_version = xml.plugin['$'].version;
+                        shelljs.sed('-i', new RegExp('version="' + 
prev_version + '"','i'), 'version="' + version + '"', xmlFile);
                     });
                 });
             } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to