diff options
| author | XhmikosR <[email protected]> | 2021-09-11 21:56:28 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2021-09-28 19:09:04 +0300 |
| commit | a74f33c40649711293a009ada8b7c21330a999a5 (patch) | |
| tree | bc0135f3bcfd45ed9a0a140038cd077e8e3c2317 /build/change-version.js | |
| parent | a82d31f4329c4dd8fabf258d807917dfed4dcca1 (diff) | |
| download | bootstrap-main-xmr-js-wip.tar.xz bootstrap-main-xmr-js-wip.zip | |
Prefer using function expressionsmain-xmr-js-wip
Diffstat (limited to 'build/change-version.js')
| -rw-r--r-- | build/change-version.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/build/change-version.js b/build/change-version.js index 63f231ea2..dd55393cb 100644 --- a/build/change-version.js +++ b/build/change-version.js @@ -26,15 +26,11 @@ const GLOBBY_OPTIONS = { } // Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37 -function regExpQuote(string) { - return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') -} +const regExpQuote = string => string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') -function regExpQuoteReplacement(string) { - return string.replace(/\$/g, '$$') -} +const regExpQuoteReplacement = string => string.replace(/\$/g, '$$') -async function replaceRecursively(file, oldVersion, newVersion) { +const replaceRecursively = async (file, oldVersion, newVersion) => { const originalString = await fs.readFile(file, 'utf8') const newString = originalString.replace( new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion) @@ -56,7 +52,7 @@ async function replaceRecursively(file, oldVersion, newVersion) { await fs.writeFile(file, newString, 'utf8') } -async function main(args) { +const main = async args => { const [oldVersion, newVersion] = args if (!oldVersion || !newVersion) { |
