mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(cli): mismatched versions check for pnpm (#14481)
This commit is contained in:
6
.changes/pnpm-package-version-check.md
Normal file
6
.changes/pnpm-package-version-check.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-cli": patch:bug
|
||||
"@tauri-apps/cli": patch:bug
|
||||
---
|
||||
|
||||
Fixed the mismatched tauri package versions check didn't work for pnpm
|
||||
@@ -332,7 +332,14 @@ impl PackageManager {
|
||||
version: String,
|
||||
}
|
||||
|
||||
let json: ListOutput = serde_json::from_str(&stdout).context("failed to parse npm list")?;
|
||||
let json = if matches!(self, PackageManager::Pnpm) {
|
||||
serde_json::from_str::<Vec<ListOutput>>(&stdout)
|
||||
.ok()
|
||||
.and_then(|out| out.into_iter().next())
|
||||
.context("failed to parse pnpm list")?
|
||||
} else {
|
||||
serde_json::from_str::<ListOutput>(&stdout).context("failed to parse npm list")?
|
||||
};
|
||||
for (package, dependency) in json.dependencies.into_iter().chain(json.dev_dependencies) {
|
||||
let version = dependency.version;
|
||||
if let Ok(version) = semver::Version::parse(&version) {
|
||||
|
||||
Reference in New Issue
Block a user