Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show new version in non-interactive mode #679

Conversation

tommy-mitchell
Copy link
Collaborator

Closes #375.

Shows the new version in non-interactive mode (e.g. when running np minor) in pretty-diff form:

image

@@ -20,7 +20,7 @@ class Version {
getNewVersionFrom(input) {
module.exports.validate(this.version);
if (!module.exports.isValidInput(input)) {
throw new Error(`Version should be either ${module.exports.SEMVER_INCREMENTS.join(', ')} or a valid semver version.`);
throw new Error(`Version should be either ${module.exports.SEMVER_INCREMENTS.join(', ')}, or a valid semver version.`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comma here to match the comma that was in prerequisite-tasks:

if (!version.isValidInput(input)) {
throw new Error(`Version should be either ${version.SEMVER_INCREMENTS.join(', ')}, or a valid semver version.`);
}

@sindresorhus sindresorhus merged commit a0a17fd into sindresorhus:main Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show versions in non-interactive mode (e.g. $ np minor)
2 participants