Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Cannot bump a prerelease identifier containing a dot when preid is specified #17

@gilly3

Description

@gilly3

Given a version with a prerelease identifier containing a dot, such as 1.0.0-foo.bar.0, if bump() is called with preid specified, the version is unchanged:

const bump = require("bump-regex");
const bumpOpts = {
    str: 'version: "1.0.0-foo.bar.0"',
    type: "prerelease",
    preid: "foo.bar"
};
bump(bumpOpts, (err, out) => console.log(out));

Output:

{ key: 'version',
  type: 'prerelease',
  case: false,
  keys: null,
  str: 'version: "1.0.0-foo.bar.0"',
  preid: 'foo.bar',
  prev: '1.0.0-foo.bar.0',
  new: '1.0.0-foo.bar.0' }

Notice that out.prev === out.new.

I've found that if I omit the preid option, it is bumped correctly:

const bump = require("bump-regex");
const bumpOpts = {
    str: 'version: "1.0.0-foo.bar.0"',
    type: "prerelease"
};
bump(bumpOpts, (err, out) => console.log(out));

Output:

{ key: 'version',
  type: 'prerelease',
  case: false,
  keys: null,
  str: 'version: "1.0.0-foo.bar.1"',
  prev: '1.0.0-foo.bar.0',
  new: '1.0.0-foo.bar.1' }

I would expect that specifying preid would not cause the bump to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions