Skip to content

Commit

Permalink
fix: sanitize double quotes result from stdout (#186)
Browse files Browse the repository at this point in the history
Co-authored-by: Inder <[email protected]>
  • Loading branch information
singh-inder and singh-inder authored Sep 15, 2024
1 parent fd73a67 commit 8dbeb79
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 8dbeb79

Please sign in to comment.