fix(config-sync): roll back failed profile saves
This commit is contained in:
1 parent
297a52aed8
commit
3f2f514097
4 files changed
+111
-33
No files matched your search
+1
-10
@@ -268,16 +268,7 @@ fn profile_instance(matches: &ArgMatches) -> CliResult {
|
||||
} else {
|
||||
Some(profile.as_str())
|
||||
};
|
||||
let instance_dir = manager.instances_dir.join(&config.name);
|
||||
let selected = crate::instance::config_sync::switch_profile(
|
||||
&config.name,
|
||||
config.config_sync_profile.as_deref(),
|
||||
target,
|
||||
&manager.meta_dir,
|
||||
&instance_dir,
|
||||
)?;
|
||||
config.config_sync_profile = selected;
|
||||
manager.save(&config)?;
|
||||
crate::instance::config_sync::switch_profile_and_save(&manager, &mut config, target)?;
|
||||
|
||||
println!(
|
||||
"Updated '{}' config profile to {}.",
|
||||
|
||||
Reference in new issue
Block a user