mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-25 03:33:36 +03:00
fix(bundler): remove fallback for license_file (#8948)
* fix(bundler): remove fallback for license_file closes #8944 * Update .changes/bundler-license.md * use license only on rpm * change file * Update .changes/bundler-rpm-license.md --------- Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
This commit is contained in:
parent
6e3bd4b9f8
commit
84c783f6bc
5
.changes/bundler-license.md
Normal file
5
.changes/bundler-license.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri-bundler': 'patch:bug'
|
||||
---
|
||||
|
||||
Fix NSIS installer always containing a license page even though `licenseFile` option is not set in the config.
|
5
.changes/bundler-rpm-license.md
Normal file
5
.changes/bundler-rpm-license.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch:bug
|
||||
---
|
||||
|
||||
Don't fallback to `licenseFile` and use only `license` field when building RPM.
|
@ -45,10 +45,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
|
||||
|
||||
info!(action = "Bundling"; "{} ({})", package_name, package_path.display());
|
||||
|
||||
let license = settings
|
||||
.license_file()
|
||||
.map(|l| std::fs::read_to_string(l).expect("failed to read license"))
|
||||
.unwrap_or_default();
|
||||
let license = settings.license().unwrap_or_default();
|
||||
let mut builder = rpm::PackageBuilder::new(name, version, &license, arch, summary)
|
||||
.epoch(epoch)
|
||||
.release(release);
|
||||
|
@ -894,17 +894,14 @@ impl Settings {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the bundle license.
|
||||
pub fn license(&self) -> Option<String> {
|
||||
self.bundle_settings.license.clone()
|
||||
}
|
||||
|
||||
/// Returns the bundle license file.
|
||||
pub fn license_file(&self) -> Option<PathBuf> {
|
||||
self.bundle_settings.license_file.clone().or_else(|| {
|
||||
self.bundle_settings.license.as_deref().map(|l| {
|
||||
let p = self
|
||||
.project_out_directory()
|
||||
.join(format!("{}-license", self.bundle_identifier()));
|
||||
std::fs::write(&p, l).expect("failed to write license to a temp file");
|
||||
p
|
||||
})
|
||||
})
|
||||
self.bundle_settings.license_file.clone()
|
||||
}
|
||||
|
||||
/// Returns the package's homepage URL, defaulting to "" if not defined.
|
||||
|
Loading…
Reference in New Issue
Block a user