Skip to content

Commit

Permalink
fix: fixing bug with major version generic updater
Browse files Browse the repository at this point in the history
  • Loading branch information
faradayfan committed Nov 18, 2024
1 parent 33e2d6d commit 7157c10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/updaters/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {logger as defaultLogger, Logger} from '../util/logger';

const VERSION_REGEX =
/(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<preRelease>[\w.]+))?(\+(?<build>[-\w.]+))?/;
const MAJOR_VERSION_REGEX = /\d+\b/
const SINGLE_VERSION_REGEX = /\b\d+\b/;
const INLINE_UPDATE_REGEX =
/x-release-please-(?<scope>major|minor|patch|version)/;
Expand Down Expand Up @@ -91,7 +92,7 @@ export class Generic extends DefaultUpdater {
function replaceVersion(line: string, scope: BlockScope, version: Version) {
switch (scope) {
case 'major':
newLines.push(line.replace(SINGLE_VERSION_REGEX, `${version.major}`));
newLines.push(line.replace(MAJOR_VERSION_REGEX, `${version.major}`));
return;
case 'minor':
newLines.push(line.replace(SINGLE_VERSION_REGEX, `${version.minor}`));
Expand Down

0 comments on commit 7157c10

Please sign in to comment.