|
@@ -124,19 +124,22 @@ pub fn exec(
|
|
if r.is_match(&bin_stem) {
|
|
if r.is_match(&bin_stem) {
|
|
if let Some(npm_execpath) = var_os("npm_execpath").map(PathBuf::from) {
|
|
if let Some(npm_execpath) = var_os("npm_execpath").map(PathBuf::from) {
|
|
let manager_stem = npm_execpath.file_stem().unwrap().to_os_string();
|
|
let manager_stem = npm_execpath.file_stem().unwrap().to_os_string();
|
|
- let manager = if manager_stem == "npm-cli" {
|
|
|
|
|
|
+ binary = if manager_stem == "npm-cli" {
|
|
"npm".into()
|
|
"npm".into()
|
|
} else {
|
|
} else {
|
|
manager_stem
|
|
manager_stem
|
|
};
|
|
};
|
|
- binary = manager;
|
|
|
|
if !build_args.is_empty() {
|
|
if !build_args.is_empty() {
|
|
// remove script path, we'll use `npm_lifecycle_event` instead
|
|
// remove script path, we'll use `npm_lifecycle_event` instead
|
|
build_args.remove(0);
|
|
build_args.remove(0);
|
|
}
|
|
}
|
|
- build_args.insert(0, "--".into());
|
|
|
|
|
|
+ if binary == "npm" {
|
|
|
|
+ build_args.insert(0, "--".into());
|
|
|
|
+ }
|
|
build_args.insert(0, var("npm_lifecycle_event").unwrap());
|
|
build_args.insert(0, var("npm_lifecycle_event").unwrap());
|
|
- build_args.insert(0, "run".into());
|
|
|
|
|
|
+ if binary == "npm" {
|
|
|
|
+ build_args.insert(0, "run".into());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
map.insert("tauri-binary", binary.to_string_lossy());
|
|
map.insert("tauri-binary", binary.to_string_lossy());
|