Skip to content

Commit 8683038

Browse files
committed
feat: v0.1.7
1 parent 4e6f0b4 commit 8683038

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hyperlane-cli"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
readme = "README.md"
55
edition = "2024"
66
authors = ["root@ltpp.vip"]

src/bump/enum.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/// Types of version bumps
22
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
33
pub(crate) enum BumpVersionType {
4-
/// Bump patch version (0.1.2 -> 0.1.3)
4+
/// Bump patch version (0.1.0 -> 0.1.1)
55
Patch,
6-
/// Bump minor version (0.1.2 -> 0.2.0)
6+
/// Bump minor version (0.1.0 -> 0.2.0)
77
Minor,
8-
/// Bump major version (0.1.2 -> 1.0.0)
8+
/// Bump major version (0.1.0 -> 1.0.0)
99
Major,
1010
/// Remove pre-release identifier to make it a release version
1111
Release,
12-
/// Add or bump alpha pre-release version (0.1.2 -> 0.1.2-alpha, 0.1.2-alpha -> 0.1.2-alpha.1)
12+
/// Add or bump alpha pre-release version (0.1.0 -> 0.1.0-alpha, 0.1.0-alpha -> 0.1.0-alpha.1)
1313
Alpha,
14-
/// Add or bump beta pre-release version (0.1.2 -> 0.1.2-beta, 0.1.2-alpha.2 -> 0.1.2-beta.1)
14+
/// Add or bump beta pre-release version (0.1.0 -> 0.1.0-beta, 0.1.0-alpha.2 -> 0.1.0-beta.1)
1515
Beta,
16-
/// Add or bump rc pre-release version (0.1.2 -> 0.1.2-rc, 0.1.2-beta.1 -> 0.1.2-rc.1)
16+
/// Add or bump rc pre-release version (0.1.0 -> 0.1.0-rc, 0.1.0-beta.1 -> 0.1.0-rc.1)
1717
Rc,
1818
}

src/bump/fn.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::*;
44
///
55
/// # Arguments
66
///
7-
/// - `&str`: The version string to parse (e.g., "0.1.2" or "0.1.2-alpha")
7+
/// - `&str`: The version string to parse (e.g., "0.1.0" or "0.1.0-alpha")
88
///
99
/// # Returns
1010
///
@@ -79,7 +79,7 @@ fn get_next_prerelease(current: Option<&String>, target_type: &str) -> String {
7979
///
8080
/// # Returns
8181
///
82-
/// - `String`: Version string (e.g., "0.1.2" or "0.1.2-alpha")
82+
/// - `String`: Version string (e.g., "0.1.0" or "0.1.0-alpha")
8383
fn version_to_string(version: &Version) -> String {
8484
let base: String = format!("{}.{}.{}", version.major, version.minor, version.patch);
8585
match &version.prerelease {
@@ -93,12 +93,12 @@ fn version_to_string(version: &Version) -> String {
9393
/// # Arguments
9494
///
9595
/// - `&Version`: The current version
96-
/// - `BumpVersionType`: The type of version bump to apply
96+
/// - `&BumpVersionType`: The type of version bump to apply
9797
///
9898
/// # Returns
9999
///
100100
/// - `Version`: The new version after bumping
101-
fn bump_version(version: &Version, bump_type: BumpVersionType) -> Version {
101+
fn bump_version(version: &Version, bump_type: &BumpVersionType) -> Version {
102102
match bump_type {
103103
BumpVersionType::Patch => Version {
104104
major: version.major,
@@ -183,14 +183,14 @@ fn find_version_position(line: &str) -> Option<(usize, usize)> {
183183
/// # Arguments
184184
///
185185
/// - `&str`: Path to Cargo.toml file
186-
/// - `BumpVersionType`: Type of version bump to apply
186+
/// - `&BumpVersionType`: Type of version bump to apply
187187
///
188188
/// # Returns
189189
///
190190
/// - `Result<String, Box<dyn std::error::Error>>`: The new version string or an error
191191
pub(crate) fn execute_bump(
192192
manifest_path: &str,
193-
bump_type: BumpVersionType,
193+
bump_type: &BumpVersionType,
194194
) -> Result<String, Box<dyn std::error::Error>> {
195195
let path: &Path = Path::new(manifest_path);
196196
let content: String = read_to_string(path)?;

src/help/fn.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ pub(crate) fn print_help() {
1515
println!(" <PROJECT_NAME> Name of the project to create");
1616
println!();
1717
println!("Bump Options:");
18-
println!(" --patch Bump patch version (0.1.2 -> 0.1.3) [default]");
19-
println!(" --minor Bump minor version (0.1.2 -> 0.2.0)");
20-
println!(" --major Bump major version (0.1.2 -> 1.0.0)");
18+
println!(" --patch Bump patch version (0.1.0 -> 0.1.1) [default]");
19+
println!(" --minor Bump minor version (0.1.0 -> 0.2.0)");
20+
println!(" --major Bump major version (0.1.0 -> 1.0.0)");
2121
println!(
22-
" --alpha Add or bump alpha version (0.1.2 -> 0.1.2-alpha, 0.1.2-alpha -> 0.1.2-alpha.1)"
22+
" --alpha Add or bump alpha version (0.1.0 -> 0.1.0-alpha, 0.1.0-alpha -> 0.1.0-alpha.1)"
2323
);
2424
println!(
25-
" --beta Add or bump beta version (0.1.2 -> 0.1.2-beta, 0.1.2-alpha.2 -> 0.1.2-beta.1)"
25+
" --beta Add or bump beta version (0.1.0 -> 0.1.0-beta, 0.1.0-alpha.2 -> 0.1.0-beta.1)"
2626
);
2727
println!(
28-
" --rc Add or bump rc version (0.1.2 -> 0.1.2-rc, 0.1.2-beta.1 -> 0.1.2-rc.1)"
28+
" --rc Add or bump rc version (0.1.0 -> 0.1.0-rc, 0.1.0-beta.1 -> 0.1.0-rc.1)"
2929
);
30-
println!(" --release Remove pre-release identifier (0.1.2-alpha -> 0.1.2)");
30+
println!(" --release Remove pre-release identifier (0.1.0-alpha -> 0.1.0)");
3131
println!(" --manifest-path <PATH> Path to Cargo.toml [default: Cargo.toml]");
3232
println!();
3333
println!("Fmt Options:");

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async fn main() {
4747
.manifest_path
4848
.unwrap_or_else(|| "Cargo.toml".to_string());
4949
let bump_type: BumpVersionType = args.bump_type.unwrap_or(BumpVersionType::Patch);
50-
match execute_bump(&manifest_path, bump_type) {
50+
match execute_bump(&manifest_path, &bump_type) {
5151
Ok(new_version) => {
5252
println!("Version bumped to {new_version}");
5353
}

0 commit comments

Comments
 (0)