From 53ee980f24373bc905a209cc28f5c619cb055d70 Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Fri, 5 Aug 2022 16:24:31 +1200 Subject: [PATCH] Fix JSON versioning regex --- .backstage/version.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.backstage/version.cjs b/.backstage/version.cjs index 3eae1cb8..085b1391 100644 --- a/.backstage/version.cjs +++ b/.backstage/version.cjs @@ -2,7 +2,7 @@ const fs = require("fs"); const path = require("path"); const version = process.env.GIT_VERSION; -const version_re = /version\s*[=:]\s*"0.0.0"/; +const version_re = /"?version"?\s*[=:]\s*"0.0.0"/; const err = (m) => { console.error(m); @@ -28,5 +28,5 @@ pagefindWebCfg.contents = pagefindWebCfg.contents.replace(version_re, `version = fs.writeFileSync(pagefindWebCfg.path, pagefindWebCfg.contents); let pagefindUiCfg = file("../pagefind_ui/package.json"); -pagefindUiCfg.contents = pagefindUiCfg.contents.replace(version_re, `version: "${version}"`); +pagefindUiCfg.contents = pagefindUiCfg.contents.replace(version_re, `"version": "${version}"`); fs.writeFileSync(pagefindUiCfg.path, pagefindUiCfg.contents);