mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(cli): merge config based on the first one (#13117)
* fix(cli): merge config based on the first one * Add change file
This commit is contained in:
6
.changes/merge-config-based-on-first.md
Normal file
6
.changes/merge-config-based-on-first.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
tauri-cli: patch:bug
|
||||
"@tauri-apps/cli": patch:bug
|
||||
---
|
||||
|
||||
Fix setting merge config value to null with `--config` arg no longer works
|
||||
@@ -164,15 +164,16 @@ fn get_internal(
|
||||
}
|
||||
|
||||
if !merge_configs.is_empty() {
|
||||
let mut merge_config = serde_json::Value::Object(Default::default());
|
||||
for conf in merge_configs {
|
||||
// We have check merge config is not empty above
|
||||
let mut merge_config = merge_configs[0].clone();
|
||||
for conf in merge_configs.iter().skip(1) {
|
||||
merge(&mut merge_config, conf);
|
||||
}
|
||||
|
||||
let merge_config_str = serde_json::to_string(&merge_config).unwrap();
|
||||
set_var("TAURI_CONFIG", merge_config_str);
|
||||
merge(&mut config, &merge_config);
|
||||
extensions.insert(MERGE_CONFIG_EXTENSION_NAME.into(), merge_config.clone());
|
||||
extensions.insert(MERGE_CONFIG_EXTENSION_NAME.into(), merge_config);
|
||||
}
|
||||
|
||||
if config_path.extension() == Some(OsStr::new("json"))
|
||||
@@ -253,8 +254,9 @@ pub fn merge_with(merge_configs: &[&serde_json::Value]) -> crate::Result<ConfigH
|
||||
}
|
||||
|
||||
if let Some(config_metadata) = &mut *handle.lock().unwrap() {
|
||||
let mut merge_config = serde_json::Value::Object(Default::default());
|
||||
for conf in merge_configs {
|
||||
// We have check merge config is not empty above
|
||||
let mut merge_config = merge_configs[0].clone();
|
||||
for conf in merge_configs.iter().skip(1) {
|
||||
merge(&mut merge_config, conf);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user