From dc6cf4d45b7f55e13acca77fa3f4bf938fbfde6c Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Tue, 14 Jul 2020 03:12:29 +0200 Subject: [PATCH] chore: fix update-plugin-xml.js --- scripts/update-plugin-xml.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/update-plugin-xml.js b/scripts/update-plugin-xml.js index 83818561..b737c2ec 100644 --- a/scripts/update-plugin-xml.js +++ b/scripts/update-plugin-xml.js @@ -1,5 +1,5 @@ const args = process.argv.slice(2); -const fs = require('mz/fs'); +const fs = require('fs'); const path = require('path'); const xml2js = require('xml2js'); const xmlPath = path.join(__dirname, '..', 'plugin.xml'); @@ -22,10 +22,12 @@ const stringify = obj => { return builder.buildObject(obj); }; -fs.readFile(xmlPath, 'utf-8') - .then(xml => parse(xml)) - .then(parsed => { - parsed.plugin.$.version = args[0]; +const update = async (version) => { + const xml = fs.readFileSync(xmlPath, 'utf-8'); + const parsed = await parse(xml); - return fs.writeFile(xmlPath, stringify(parsed)); - }); + parsed.plugin.$.version = version; + fs.writeFileSync(xmlPath, stringify(parsed)); +}; + +return update(args[0]);