fix(theseus): Fixed multiple bugs (#1304)

* fix(theseus): Resolve log tab freezing entire app (#1127, #1237)
Switched to `vue-typed-virtual-list` due to freezing issues in WebKit caused by `vue-virtual-scroller`, which were difficult to resolve with the previous library.

* fix(theseus): Double opening of Socials Share link (#1136, #1074)

* fix(theseus): Proper symlinks resolution (#1236)
Ensures correct symlink resolution for specific mods, the mods directory, and the entire profile directory.

* fix(theseus): Correctly recognize NeoForge mods (#1215)

* fix(theseus): Corrected `Environments` and `Loaders` filters (#899)

* fix(theseus): Remove `_JAVA_OPTIONS` when testing JRE (#1171)

* fix(theseus): Fixed opening files using `show_in_folder`
Previously, opening a mod would display the contents of the JAR file instead of its location.

* fix(theseus): Hide `.DS_Store` files (#1274, #1002, #1174)

* fix(theseus): Corrected tooltip color

* fix(theseus): Fixed white mode issues (#1144, #1010)

* fix: Corrected `Slider` min and max value handling (#1008)

* fix: Fixed rebase problems

* fix: Fixed `:deep` usage warning

* chore: Updated eslint plugins to fix conflicts with Prettier
This commit is contained in:
Norbiros
2024-07-20 02:20:12 +02:00
committed by GitHub
parent f1713647cf
commit 797e1f1f21
18 changed files with 441 additions and 426 deletions

View File

@@ -22,6 +22,8 @@ use serde::{Deserialize, Serialize};
use std::io::Cursor;
use std::{
collections::HashMap,
ffi::OsStr,
path,
path::{Path, PathBuf},
};
use uuid::Uuid;
@@ -65,7 +67,6 @@ impl ProfilePathId {
.ok_or_else(|| {
crate::ErrorKind::FSError(format!(
"Path {path:?} does not correspond to a profile",
path = path
))
})?;
Ok(Self(path))
@@ -150,14 +151,15 @@ impl From<InnerProjectPathUnix> for RawProjectPath {
pub struct ProjectPathId(pub PathBuf);
impl ProjectPathId {
// Create a new ProjectPathId from a full file path
pub async fn from_fs_path(path: &PathBuf) -> crate::Result<Self> {
pub async fn from_fs_path(path: &Path) -> crate::Result<Self> {
// This is avoiding dunce::canonicalize deliberately. On Windows, paths will always be convert to UNC,
// but this is ok because we are stripping that with the prefix. Using std::fs avoids different behaviors with dunce that
// come with too-long paths
let profiles_dir: PathBuf = std::fs::canonicalize(
State::get().await?.directories.profiles_dir().await,
)?;
let path: PathBuf = std::fs::canonicalize(path)?;
// Normal canonizing resolves symlinks, which results in "path not corresponding to profile" error
let path = path::absolute(path)?;
let path = path
.strip_prefix(profiles_dir)
.ok()
@@ -165,7 +167,6 @@ impl ProjectPathId {
.ok_or_else(|| {
crate::ErrorKind::FSError(format!(
"Path {path:?} does not correspond to a profile",
path = path
))
})?;
Ok(Self(path))
@@ -485,7 +486,9 @@ impl Profile {
.map_err(|e| IOError::with_path(e, &new_path))?
{
let subpath = subpath.map_err(IOError::from)?.path();
if subpath.is_file() {
if subpath.is_file()
&& subpath.file_name() != Some(OsStr::new(".DS_Store"))
{
files.push(subpath);
}
}
@@ -609,6 +612,7 @@ impl Profile {
})?;
if archive.by_name("fabric.mod.json").is_ok()
|| archive.by_name("quilt.mod.json").is_ok()
|| archive.by_name("META-INF/neoforge.mods.toml").is_ok()
|| archive.by_name("META-INF/mods.toml").is_ok()
|| archive.by_name("mcmod.info").is_ok()
{

View File

@@ -33,7 +33,7 @@ impl ProjectType {
pub fn get_from_loaders(loaders: Vec<String>) -> Option<Self> {
if loaders
.iter()
.any(|x| ["fabric", "forge", "quilt"].contains(&&**x))
.any(|x| ["fabric", "forge", "quilt", "neoforge"].contains(&&**x))
{
Some(ProjectType::Mod)
} else if loaders.iter().any(|x| x == "datapack") {

View File

@@ -294,6 +294,7 @@ pub async fn check_java_at_filepath(path: &Path) -> Option<JavaVersion> {
.arg("-cp")
.arg(file_path.parent().unwrap())
.arg("JavaInfo")
.env_remove("_JAVA_OPTIONS")
.output()
.ok()?;