mac download (#77)

* mac download

* clippy
This commit is contained in:
Wyatt Verchere
2023-04-11 07:15:37 -07:00
committed by GitHub
parent d23bc4450d
commit ac6ad0ef2e
10 changed files with 63 additions and 25 deletions

View File

@@ -57,7 +57,6 @@ pub async fn authenticate(
Ok(credentials)
}
/// Refresh some credentials using Hydra, if needed
/// This is the primary desired way to get credentials, as it will also refresh them.
#[tracing::instrument]

View File

@@ -54,8 +54,12 @@ pub async fn get_optimal_jre_key(profile: &Profile) -> crate::Result<String> {
})?;
// Get detailed manifest info from Daedalus
let version_info =
download::download_version_info(&state, version, profile.metadata.loader_version.as_ref()).await?;
let version_info = download::download_version_info(
&state,
version,
profile.metadata.loader_version.as_ref(),
)
.await?;
let optimal_key = match version_info
.java_version
.as_ref()

View File

@@ -146,8 +146,12 @@ pub async fn run_credentials(
profile.metadata.game_version
))
})?;
let version_info =
download::download_version_info(&state, version, profile.metadata.loader_version.as_ref()).await?;
let version_info = download::download_version_info(
&state,
version,
profile.metadata.loader_version.as_ref(),
)
.await?;
let pre_launch_hooks =
&profile.hooks.as_ref().unwrap_or(&settings.hooks).pre_launch;
for hook in pre_launch_hooks.iter() {

View File

@@ -20,5 +20,6 @@ pub async fn set(settings: Settings) -> crate::Result<()> {
let state = State::get().await?;
// Replaces the settings struct in the RwLock with the passed argument
*state.settings.write().await = settings;
state.reset_semaphore().await; // reset semaphore to new max
Ok(())
}