Forráskód Böngészése

fix(cli.rs): `info` command `npm_package_version` parsing `beta-rc` (#1587)

Lucas Fernandes Nogueira 4 éve
szülő
commit
0012782e43
2 módosított fájl, 6 hozzáadás és 1 törlés
  1. 5 0
      .changes/fix-info-npm-version.md
  2. 1 1
      tooling/cli.rs/src/info.rs

+ 5 - 0
.changes/fix-info-npm-version.md

@@ -0,0 +1,5 @@
+---
+"cli.rs": patch
+---
+
+Fixes `tauri info` display version for the `@tauri-apps/api` package.

+ 1 - 1
tooling/cli.rs/src/info.rs

@@ -178,7 +178,7 @@ fn npm_package_version<P: AsRef<Path>>(
   };
   if output.status.success() {
     let stdout = String::from_utf8_lossy(&output.stdout);
-    let regex = regex::Regex::new("@([\\da-zA-Z\\.]+)").unwrap();
+    let regex = regex::Regex::new("@([\\da-zA-Z\\-\\.]+)").unwrap();
     Ok(
       regex
         .captures_iter(&stdout)