mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-01 19:44:39 +03:00
fix(bundler) do not require [package.metadata.bundle] for tauri… (#492)
This commit is contained in:
parent
6ef2b16796
commit
493f1ea0c8
@ -90,7 +90,7 @@ pub enum BuildArtifact {
|
||||
Example(String),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[derive(Clone, Debug, Deserialize, Default)]
|
||||
struct BundleSettings {
|
||||
// General settings:
|
||||
name: Option<String>,
|
||||
@ -200,6 +200,8 @@ impl Settings {
|
||||
None
|
||||
};
|
||||
let cargo_settings = CargoSettings::load(¤t_dir)?;
|
||||
let tauri_config = super::tauri_config::get();
|
||||
|
||||
let package = match cargo_settings.package {
|
||||
Some(package_info) => package_info,
|
||||
None => bail!("No 'package' info found in 'Cargo.toml'"),
|
||||
@ -213,7 +215,11 @@ impl Settings {
|
||||
{
|
||||
bundle_settings.clone()
|
||||
} else {
|
||||
bail!("No [package.metadata.bundle] section in Cargo.toml");
|
||||
if let Ok(_) = tauri_config {
|
||||
BundleSettings::default()
|
||||
} else {
|
||||
bail!("No [package.metadata.bundle] section in Cargo.toml");
|
||||
}
|
||||
};
|
||||
let (bundle_settings, binary_name) = match build_artifact {
|
||||
BuildArtifact::Main => (bundle_settings, package.name.clone()),
|
||||
@ -235,7 +241,6 @@ impl Settings {
|
||||
|
||||
let bundle_settings = add_external_bin(bundle_settings)?;
|
||||
|
||||
let tauri_config = super::tauri_config::get();
|
||||
let merged_bundle_settings = match tauri_config {
|
||||
Ok(config) => merge_settings(bundle_settings, config.tauri.bundle),
|
||||
Err(_) => bundle_settings,
|
||||
|
Loading…
Reference in New Issue
Block a user