]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
build/change-version.js: fix wrong map usage (#35395)
authorXhmikosR <xhmikosr@gmail.com>
Wed, 24 Nov 2021 08:49:35 +0000 (10:49 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 16 Dec 2021 07:23:08 +0000 (09:23 +0200)
build/change-version.js

index 08313c1e815eb8877218d1e17a394c4afe9b5480..841e0360aa3a35d1abe4cb06f679c3f66a3591af 100755 (executable)
@@ -57,7 +57,7 @@ async function replaceRecursively(file, oldVersion, newVersion) {
 }
 
 async function main(args) {
-  const [oldVersion, newVersion] = args
+  let [oldVersion, newVersion] = args
 
   if (!oldVersion || !newVersion) {
     console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
@@ -66,7 +66,7 @@ async function main(args) {
   }
 
   // Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
-  [oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
+  [oldVersion, newVersion] = [oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
 
   try {
     const files = await globby(GLOB, GLOBBY_OPTIONS)