Skip to content

Commit 862bc55

Browse files
authored
Merge pull request #42 from Sythelux/master
fix: fixed version parsing for godot containing mono
2 parents eaefd45 + aaa5e78 commit 862bc55

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

godot-codegen/src/godot_version.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct GodotVersion {
2828

2929
pub fn parse_godot_version(version_str: &str) -> Result<GodotVersion, Box<dyn Error>> {
3030
let regex = Regex::new(
31-
r#"(\d+)\.(\d+)(?:\.(\d+))?\.(alpha|beta|dev|stable)[0-9]*\.(?:(?:official|custom_build)\.([a-f0-9]+)|official)"#,
31+
r#"(\d+)\.(\d+)(?:\.(\d+))?\.(alpha|beta|dev|stable)[0-9]*\.(?:mono)\.(?:(?:official|custom_build)\.([a-f0-9]+)|official)"#,
3232
)?;
3333

3434
let caps = regex.captures(version_str).ok_or("Regex capture failed")?;
@@ -73,6 +73,7 @@ fn test_godot_versions() {
7373
("3.5.beta.custom_build.837f2c5f8", 3, 5, 0, "beta", s("837f2c5f8")),
7474
("4.0.dev.custom_build.e7e9e663b", 4, 0, 0, "dev", s("e7e9e663b")),
7575
("4.0.alpha.custom_build.faddbcfc0", 4, 0, 0, "alpha", s("faddbcfc0")),
76+
("4.0.beta8.mono.custom_build.b28ddd918", 4, 0, 0, "beta", s("b28ddd918")),
7677
];
7778

7879
let bad_versions = [

0 commit comments

Comments
 (0)