mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix: update nodejs detection in mobile commands (#6451)
* fix: update nodejs detection in mobile commands * changefile
This commit is contained in:
5
.changes/cli-nodejs-detection.md
Normal file
5
.changes/cli-nodejs-detection.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'cli.rs': 'patch'
|
||||
---
|
||||
|
||||
In mobile commands, correctly detect when nodejs binary has the version in its name, for example `node-18`
|
||||
@@ -120,7 +120,7 @@ pub fn exec(
|
||||
|
||||
let binary_path = PathBuf::from(&binary);
|
||||
let bin_stem = binary_path.file_stem().unwrap().to_string_lossy();
|
||||
let r = regex::Regex::new("(nodejs|node)([1-9]*)*$").unwrap();
|
||||
let r = regex::Regex::new("(nodejs|node)\\-?([1-9]*)*$").unwrap();
|
||||
if r.is_match(&bin_stem) {
|
||||
if let Some(npm_execpath) = var_os("npm_execpath").map(PathBuf::from) {
|
||||
let manager_stem = npm_execpath.file_stem().unwrap().to_os_string();
|
||||
|
||||
Reference in New Issue
Block a user