Skip to content

Commit

Permalink
Fix JSON versioning regex
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Aug 5, 2022
1 parent 89968f1 commit 53ee980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .backstage/version.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

0 comments on commit 53ee980

Please sign in to comment.