Skip to content

Commit

Permalink
Relax leading "v"
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Oct 3, 2024
1 parent 1171129 commit 05e0caf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdk/cargo-build-sbf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ where
}

pub fn is_version_string(arg: &str) -> Result<(), String> {
let semver_re = Regex::new(r"^v[0-9]+\.[0-9]+(\.[0-9]+)?").unwrap();
let semver_re = Regex::new(r"^v?[0-9]+\.[0-9]+(\.[0-9]+)?").unwrap();
if semver_re.is_match(arg) {
return Ok(());
}
Err("a version string starts with 'v' and contains major and minor version numbers separated by a dot, e.g. v1.32".to_string())
Err("a version string may start with 'v' and contains major and minor version numbers separated by a dot, e.g. v1.32 or 1.32".to_string())
}

fn find_installed_platform_tools() -> Vec<String> {
Expand Down
4 changes: 2 additions & 2 deletions sdk/cargo-test-sbf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ where
}

pub fn is_version_string(arg: &str) -> Result<(), String> {
let semver_re = Regex::new(r"^v[0-9]+\.[0-9]+(\.[0-9]+)?").unwrap();
let semver_re = Regex::new(r"^v?[0-9]+\.[0-9]+(\.[0-9]+)?").unwrap();
if semver_re.is_match(arg) {
return Ok(());
}
Err("a version string starts with 'v' and contains major and minor version numbers separated by a dot, e.g. v1.32".to_string())
Err("a version string may start with 'v' and contains major and minor version numbers separated by a dot, e.g. v1.32 or 1.32".to_string())
}

fn test_solana_package(
Expand Down

0 comments on commit 05e0caf

Please sign in to comment.