mirror of
https://github.com/WarrenHood/MCModpackManager.git
synced 2025-04-30 00:04:59 +01:00
Added an update command
This commit is contained in:
parent
30626b6952
commit
2758f40b8f
11
src/main.rs
11
src/main.rs
|
@ -83,6 +83,11 @@ enum Commands {
|
||||||
#[arg(long, short, default_value_t = DownloadSide::Both)]
|
#[arg(long, short, default_value_t = DownloadSide::Both)]
|
||||||
side: DownloadSide,
|
side: DownloadSide,
|
||||||
},
|
},
|
||||||
|
Update {
|
||||||
|
/// Use exact transitive mod dependency versions
|
||||||
|
#[arg(long, short, action)]
|
||||||
|
locked: bool,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread")]
|
#[tokio::main(flavor = "multi_thread")]
|
||||||
|
@ -246,6 +251,12 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
pack_lock.download_mods(&mods_dir, side).await?;
|
pack_lock.download_mods(&mods_dir, side).await?;
|
||||||
println!("Mods updated");
|
println!("Mods updated");
|
||||||
}
|
}
|
||||||
|
Commands::Update { locked } => {
|
||||||
|
let mut pack_lock = resolver::PinnedPackMeta::new();
|
||||||
|
let modpack_meta = ModpackMeta::load_from_current_directory()?;
|
||||||
|
pack_lock.init(&modpack_meta, !locked).await?;
|
||||||
|
pack_lock.save_current_dir_lock()?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue