Skip to content

Commit

Permalink
Validate version
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki authored and medikoo committed Jan 4, 2024
1 parent 4dfa2b6 commit 18cbd0d
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 18cbd0d

Please sign in to comment.