Skip to content

Commit

Permalink
fix: sanitize double quotes result from stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
singh-inder committed Sep 13, 2024
1 parent fd73a67 commit 11f616f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/lifecycles/bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const semver = require('semver');
const writeFile = require('../write-file');
const { resolveUpdaterObjectFromArgument } = require('../updaters');
let configsToUpdate = {};
const sanitizeQuotesRegex = /['"]+/g;

async function Bump(args, version) {
// reset the cache of updated config files each
Expand All @@ -37,7 +38,7 @@ async function Bump(args, version) {
await runLifecycleScript(args, 'prerelease');
const stdout = await runLifecycleScript(args, 'prebump');
if (stdout?.trim().length) {
const prebumpString = stdout.trim();
const prebumpString = stdout.trim().replace(sanitizeQuotesRegex, '');
if (semver.valid(prebumpString)) args.releaseAs = prebumpString;
}
if (!args.firstRelease) {
Expand Down

0 comments on commit 11f616f

Please sign in to comment.