Updating + Profile Repairs + Performance Improvements (#97)

* repairing

* Main framework for updating

* add jsconfig

* more work

* Improve performance

* Finish updating

* run lint
This commit is contained in:
Geometrically
2023-04-26 10:28:08 -07:00
committed by GitHub
parent c53104c28e
commit f0b8a708a3
48 changed files with 1217 additions and 894 deletions

View File

@@ -64,6 +64,7 @@ impl ProfileInit {
) -> Result<()> {
// TODO: validate inputs from args early
let state = State::get().await?;
let metadata = state.metadata.read().await;
if self.path.exists() {
ensure!(
@@ -114,7 +115,7 @@ impl ProfileInit {
let game_version = match &self.game_version {
Some(version) => version.clone(),
None => {
let default = &state.metadata.minecraft.latest.release;
let default = &metadata.minecraft.latest.release;
prompt_async(
String::from("Game version"),
@@ -163,8 +164,8 @@ impl ProfileInit {
};
let loader_data = match loader {
ModLoader::Forge => &state.metadata.forge,
ModLoader::Fabric => &state.metadata.fabric,
ModLoader::Forge => &metadata.forge,
ModLoader::Fabric => &metadata.fabric,
_ => eyre::bail!("Could not get manifest for loader {loader}. This is a bug in the CLI!"),
};
@@ -193,6 +194,7 @@ impl ProfileInit {
loader.map(|x| x.0.id),
None,
None,
None,
)
.await?;

View File

@@ -151,7 +151,6 @@ impl UserDefault {
) -> Result<()> {
info!("Setting user {} as default", self.user.as_hyphenated());
// TODO: settings API
let state: std::sync::Arc<State> = State::get().await?;
let mut settings = state.settings.write().await;