mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
fix(cli): add MaybeWorkspace to license field (#8672)
* Add MaybeWorkspace to license field * Fix last changes * Fix formatting * Add change .MD file
This commit is contained in:
6
.changes/cli-license-field-workspace.md
Normal file
6
.changes/cli-license-field-workspace.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-cli": patch:bug
|
||||
"@tauri-apps/cli": patch:bug
|
||||
---
|
||||
|
||||
Allow license field in Cargo.toml to be `{ workspace = true }`
|
||||
@@ -612,6 +612,7 @@ struct WorkspacePackageSettings {
|
||||
description: Option<String>,
|
||||
homepage: Option<String>,
|
||||
version: Option<String>,
|
||||
license: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
@@ -635,7 +636,7 @@ pub struct CargoPackageSettings {
|
||||
/// the package's authors.
|
||||
pub authors: Option<MaybeWorkspace<Vec<String>>>,
|
||||
/// the package's license.
|
||||
pub license: Option<String>,
|
||||
pub license: Option<MaybeWorkspace<String>>,
|
||||
/// the default binary to run.
|
||||
pub default_run: Option<String>,
|
||||
}
|
||||
@@ -930,7 +931,16 @@ impl RustAppSettings {
|
||||
})
|
||||
.unwrap()
|
||||
}),
|
||||
license: cargo_package_settings.license.clone(),
|
||||
license: cargo_package_settings.license.clone().map(|license| {
|
||||
license
|
||||
.resolve("license", || {
|
||||
ws_package_settings
|
||||
.as_ref()
|
||||
.and_then(|v| v.license.clone())
|
||||
.ok_or_else(|| anyhow::anyhow!("Couldn't inherit value for `license` from workspace"))
|
||||
})
|
||||
.unwrap()
|
||||
}),
|
||||
default_run: cargo_package_settings.default_run.clone(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user