Skip to content

Commit

Permalink
Validate version
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Nov 23, 2022
1 parent 94c25d9 commit a34272d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/release/steps/validate-new-version.js
@@ -1,4 +1,4 @@
// import chalk from "chalk";
import chalk from "chalk";
import semver from "semver";

export default function validateNewVersion({ version, previousVersion }) {
Expand All @@ -7,7 +7,8 @@ export default function validateNewVersion({ version, previousVersion }) {
}

if (!semver.gt(version, previousVersion)) {
throw new Error();
// `Version ${chalk.yellow(version)} has already been published`
throw new Error(
`Version ${chalk.yellow(version)} has already been published`
);
}
}

0 comments on commit a34272d

Please sign in to comment.