Skip to content

Commit

Permalink
Fix initial --snapshot latestVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Sep 27, 2023
1 parent d4cc7a8 commit f283230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Expand Up @@ -70,9 +70,9 @@ const runTasks = async (opts, di) => {
const incrementBase = { latestVersion, increment, isPreRelease, preReleaseId };

const { snapshot } = config.options;
if (snapshot && !incrementBase.latestVersion.startsWith('0.0.0')) {
if (snapshot && (!incrementBase.latestVersion.startsWith('0.0.0') || incrementBase.latestVersion === '0.0.0')) {
// Reading the latest version first allows to increment the final counter, fake it if it's not a snapshot:
incrementBase.latestVersion = `0.0.0-${snapshot}.-1`;
incrementBase.latestVersion = `0.0.0-0`;
}

let version;
Expand Down

0 comments on commit f283230

Please sign in to comment.