1
0

Bump Theseus Version (#818)

* push to test on windows

* Fix windows sup

* Fix macos

* Fix back

* new resolver for windows testing

* Custom macos handling for some versions

* Fix 1.13+ broken

* fix arg parsing mac

* small winblows fix

* remove debug info; set meta url

* run lint + fix clippy

* Remove useless commnet
This commit is contained in:
Geometrically
2023-10-21 13:08:47 -07:00
committed by GitHub
parent 7fb8850071
commit afaec4b1bf
27 changed files with 189 additions and 97 deletions

View File

@@ -68,10 +68,14 @@ pub async fn refresh(user: uuid::Uuid) -> crate::Result<Credentials> {
}
// Update player info from bearer token
let player_info = hydra::stages::player_info::fetch_info(&credentials.access_token).await.map_err(|_err| {
crate::ErrorKind::HydraError("No Minecraft account for your profile. Make sure you own the game and have set a username through the official Minecraft launcher."
.to_string())
})?;
let player_info =
hydra::stages::player_info::fetch_info(&credentials.access_token)
.await
.map_err(|_err| {
crate::ErrorKind::HydraError(
"No Minecraft account for your profile. Please try again or contact support in our Discord for help!".to_string(),
)
})?;
credentials.username = player_info.name;
users.insert(&credentials).await?;

View File

@@ -13,7 +13,7 @@ impl Default for PlayerInfo {
fn default() -> Self {
Self {
id: "606e2ff0ed7748429d6ce1d3321c7838".to_string(),
name: String::from("???"),
name: String::from("Unknown"),
}
}
}

View File

@@ -127,7 +127,7 @@ pub async fn auto_install_java(java_version: u32) -> crate::Result<PathBuf> {
// removes the old installation of java
if let Some(file) = archive.file_names().next() {
if let Some(dir) = file.split("/").next() {
if let Some(dir) = file.split('/').next() {
let path = path.join(dir);
if path.exists() {

View File

@@ -245,8 +245,12 @@ async fn import_atlauncher_unmanaged(
if let Some(profile_val) =
crate::api::profile::get(&profile_path, None).await?
{
crate::launcher::install_minecraft(&profile_val, Some(loading_bar))
.await?;
crate::launcher::install_minecraft(
&profile_val,
Some(loading_bar),
false,
)
.await?;
{
let state = State::get().await?;
let mut file_watcher = state.file_watcher.write().await;

View File

@@ -199,8 +199,12 @@ pub async fn import_curseforge(
if let Some(profile_val) =
crate::api::profile::get(&profile_path, None).await?
{
crate::launcher::install_minecraft(&profile_val, Some(loading_bar))
.await?;
crate::launcher::install_minecraft(
&profile_val,
Some(loading_bar),
false,
)
.await?;
{
let state = State::get().await?;

View File

@@ -112,8 +112,12 @@ pub async fn import_gdlauncher(
if let Some(profile_val) =
crate::api::profile::get(&profile_path, None).await?
{
crate::launcher::install_minecraft(&profile_val, Some(loading_bar))
.await?;
crate::launcher::install_minecraft(
&profile_val,
Some(loading_bar),
false,
)
.await?;
{
let state = State::get().await?;
let mut file_watcher = state.file_watcher.write().await;

View File

@@ -323,8 +323,12 @@ async fn import_mmc_unmanaged(
if let Some(profile_val) =
crate::api::profile::get(&profile_path, None).await?
{
crate::launcher::install_minecraft(&profile_val, Some(loading_bar))
.await?;
crate::launcher::install_minecraft(
&profile_val,
Some(loading_bar),
false,
)
.await?;
{
let state = State::get().await?;
let mut file_watcher = state.file_watcher.write().await;

View File

@@ -283,8 +283,12 @@ pub async fn install_zipped_mrpack_files(
}
if let Some(profile_val) = profile::get(&profile_path, None).await? {
crate::launcher::install_minecraft(&profile_val, Some(loading_bar))
.await?;
crate::launcher::install_minecraft(
&profile_val,
Some(loading_bar),
false,
)
.await?;
State::sync().await?;
}

View File

@@ -125,7 +125,7 @@ pub async fn profile_create(
}
if !skip_install_profile.unwrap_or(false) {
crate::launcher::install_minecraft(&profile, None).await?;
crate::launcher::install_minecraft(&profile, None, false).await?;
}
State::sync().await?;
@@ -196,7 +196,8 @@ pub async fn profile_create_from_duplicate(
ErrorKind::UnmanagedProfileError(profile_path_id.to_string())
})?;
crate::launcher::install_minecraft(&duplicated_profile, Some(bar)).await?;
crate::launcher::install_minecraft(&duplicated_profile, Some(bar), false)
.await?;
{
let state = State::get().await?;
let mut file_watcher = state.file_watcher.write().await;

View File

@@ -281,9 +281,9 @@ pub async fn list(
/// Installs/Repairs a profile
#[tracing::instrument]
pub async fn install(path: &ProfilePathId) -> crate::Result<()> {
pub async fn install(path: &ProfilePathId, force: bool) -> crate::Result<()> {
if let Some(profile) = get(path, None).await? {
crate::launcher::install_minecraft(&profile, None).await?;
crate::launcher::install_minecraft(&profile, None, force).await?;
} else {
return Err(crate::ErrorKind::UnmanagedProfileError(path.to_string())
.as_error());