absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
360 stars 33 forks source link

Argument `--releaseAs [1.1.0]` is ignored if `--skip.bump` is also used #130

Open aheater18 opened 4 months ago

aheater18 commented 4 months ago

Describe the bug Running commit-and-tag-version with the option to skip the bump step uses the current version in package.json instead of using the version specified with the argument releaseAs.

Current behavior Steps following bump (changelog, commit, tag) run with the current version in package.json.

Expected behavior Other steps (changelog, commit, tag) should run with the version specified with releaseAs.

Environment

Possible Solution

In bump.js, the logic for determining the newVersion from releaseAs (I think lines 46-62) should be moved up to line 35, and the check for args.skip.bump should be moved to occur right after that, returning the releaseAs version if it exists.

Additional context Add any other context about the problem here. Or a screenshot if applicable