Skip to content

Commit

Permalink
feat: writeVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
JosepBergay committed May 11, 2021
1 parent 71fae95 commit 985a028
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@ const readVersion = contents => {
};

const writeVersion = (contents, version) => {
// const file = xml.parse(contents);
// file.version = version;
// return new xml.j2xParser().parse(file);
const doc = create(contents);
doc.find(
n => {
if (isVersion(n.node.nodeName)) {
n.node.textContent = version;
return true;
}
},
true,
true
);
return doc.end({ prettyPrint: true });
};

module.exports = {
Expand Down

0 comments on commit 985a028

Please sign in to comment.