mirror of
https://github.com/WarrenHood/MCModpackManager.git
synced 2025-04-29 09:04:59 +01:00
Actually save userdata after using the profile remove command
This commit is contained in:
parent
e6b4eff11e
commit
8cd758aa96
1
TODO.md
1
TODO.md
|
@ -18,6 +18,7 @@ This is a rather unorganised list of TODOs just so I can somewhat keep track of
|
|||
merge (retaining original/modified values) merge should result in an install dir with A and B, where a.json and b.json are in A, and a.json is the result of merging a.json into the installed a.json (retaining the existing values from the file in the install dir), and the original files in folder B untouched (x.json and y.json)
|
||||
- [ ] Test the merge apply policies when I am not half asleep
|
||||
- [ ] Show package version somewhere in `mmm`
|
||||
- [X] Save userdata after removing profiles with the remove command
|
||||
|
||||
### Nice to haves
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ mod profiles;
|
|||
mod providers;
|
||||
mod resolver;
|
||||
|
||||
use anyhow::{Error, Result};
|
||||
use anyhow::{Context, Error, Result};
|
||||
use clap::{Args, Parser, Subcommand};
|
||||
use file_meta::{get_normalized_relative_path, FileApplyPolicy, FileMeta};
|
||||
use mod_meta::{ModMeta, ModProvider};
|
||||
|
@ -507,6 +507,9 @@ async fn main() -> anyhow::Result<()> {
|
|||
ProfileCommands::Remove { name } => {
|
||||
let mut userdata = profiles::Data::load()?;
|
||||
userdata.remove_profile(&name);
|
||||
userdata.save().with_context(|| {
|
||||
format!("Failed to save userdata after removing profile {name}")
|
||||
})?;
|
||||
println!("Removed profile '{name}'");
|
||||
}
|
||||
ProfileCommands::Show { name } => {
|
||||
|
|
Loading…
Reference in a new issue