-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add --bump for version command #298
Conversation
This makes sense, but I think it needs some reasonable story to talk about post and dev versions. Currently if you are on
|
|
rye/src/cli/version.rs
Outdated
"major" => version.release[0] += 1, | ||
"minor" => version.release[1] += 1, | ||
"patch" => version.release[2] += 1, | ||
_ => return, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to give an error here on invalid input. Right now i think you could use an enum and then clap would handle it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, enum is indeed in my consideration.
rye/src/cli/version.rs
Outdated
style("warning:").red() | ||
); | ||
} else { | ||
version.release[bump as usize] += 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that you can have a version 1.0
which results in release
being [1, 0]
. This would on a minor bump cause a panic here. I think it would need to initialize missing values to 0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
➜ o git:(main) ✗ rye version
1
➜ o git:(main) ✗ rye version --bump minor
version bumped to 1.1
➜ o git:(main) ✗ rye version --bump patch
version bumped to 1.1.1
➜ o git:(main) ✗ rye version 1.0
version set to 1.0
➜ o git:(main) ✗ rye version --bump minor
version bumped to 1.1
➜ o git:(main) ✗ rye version --bump patch
version bumped to 1.1.1
#285