Skip to content

Commit 2e8ab7b

Browse files
fix(cli): v1 migration should add the updater plugin if it is enabled (#10481)
* fix(cli): v1 migration should add the updater plugin if it is enabled * fix change tag * move to process_updater * Update tooling/cli/src/migrate/migrations/v1/config.rs Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de> --------- Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
1 parent a3cd977 commit 2e8ab7b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changes/v1-migrate-updater.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Migration from v1 to v2 now adds the updater plugin when it is active.

tooling/cli/src/migrate/migrations/v1/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ fn migrate_config(config: &mut Value) -> Result<MigratedConfig> {
110110
process_cli(&mut plugins, cli)?;
111111
}
112112

113-
// cli
114-
process_updater(tauri_config, &mut plugins)?;
113+
// updater
114+
process_updater(tauri_config, &mut plugins, &mut migrated)?;
115115
}
116116

117117
config.insert("plugins".into(), plugins.into());
@@ -512,6 +512,7 @@ fn process_cli(plugins: &mut Map<String, Value>, cli: Value) -> Result<()> {
512512
fn process_updater(
513513
tauri_config: &mut Map<String, Value>,
514514
plugins: &mut Map<String, Value>,
515+
migrated: &mut MigratedConfig,
515516
) -> Result<()> {
516517
if let Some(mut updater) = tauri_config.remove("updater") {
517518
if let Some(updater) = updater.as_object_mut() {
@@ -528,6 +529,7 @@ fn process_updater(
528529
|| updater.get("pubkey").is_some()
529530
{
530531
plugins.insert("updater".into(), serde_json::to_value(updater)?);
532+
migrated.plugins.insert("updater".to_string());
531533
}
532534
}
533535
}

0 commit comments

Comments
 (0)