Profile Options (#120)

* init profile settings

* more work

* finish everything

* Switch to index approach

* Fix settings str split

* Run lint
This commit is contained in:
Geometrically
2023-05-19 18:59:32 -07:00
committed by GitHub
parent 4df7605b8d
commit 6014172046
43 changed files with 1108 additions and 709 deletions

View File

@@ -113,7 +113,7 @@ impl Children {
// Spawns a new child process and inserts it into the hashmap
// Also, as the process ends, it spawns the follow-up process if it exists
// By convention, ExitStatus is last command's exit status, and we exit on the first non-zero exit status
#[tracing::instrument]
#[tracing::instrument(skip(current_child))]
#[theseus_macros::debug_pin]
async fn sequential_process_manager(
uuid: Uuid,

View File

@@ -54,7 +54,7 @@ impl Metadata {
}
// Attempt to fetch metadata and store in sled DB
#[tracing::instrument]
#[tracing::instrument(skip(io_semaphore))]
#[theseus_macros::debug_pin]
pub async fn init(
dirs: &DirectoryInfo,

View File

@@ -130,6 +130,8 @@ pub struct JavaSettings {
pub override_version: Option<JavaVersion>,
#[serde(skip_serializing_if = "Option::is_none")]
pub extra_arguments: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_env_args: Option<Vec<(String, String)>>,
}
impl Profile {
@@ -169,7 +171,7 @@ impl Profile {
})
}
#[tracing::instrument]
#[tracing::instrument(skip(self, semaphore, icon))]
pub async fn set_icon<'a>(
&'a mut self,
cache_dir: &Path,
@@ -295,7 +297,7 @@ impl Profile {
Ok(())
}
#[tracing::instrument]
#[tracing::instrument(skip(self))]
#[theseus_macros::debug_pin]
pub async fn add_project_version(
&self,
@@ -342,7 +344,7 @@ impl Profile {
Ok((path, version))
}
#[tracing::instrument]
#[tracing::instrument(skip(self, bytes))]
#[theseus_macros::debug_pin]
pub async fn add_project_bytes(
&self,
@@ -412,7 +414,7 @@ impl Profile {
Ok(path)
}
#[tracing::instrument]
#[tracing::instrument(skip(self))]
#[theseus_macros::debug_pin]
pub async fn toggle_disable_project(
&self,
@@ -577,7 +579,7 @@ impl Profiles {
};
}
#[tracing::instrument(skip(self))]
#[tracing::instrument(skip(self, profile))]
#[theseus_macros::debug_pin]
pub async fn insert(&mut self, profile: Profile) -> crate::Result<&Self> {
emit_profile(

View File

@@ -200,7 +200,7 @@ pub enum ProjectMetadata {
Unknown,
}
#[tracing::instrument]
#[tracing::instrument(skip(io_semaphore))]
#[theseus_macros::debug_pin]
async fn read_icon_from_file(
icon_path: Option<String>,
@@ -251,7 +251,7 @@ async fn read_icon_from_file(
Ok(None)
}
#[tracing::instrument]
#[tracing::instrument(skip(profile, io_semaphore, fetch_semaphore))]
#[theseus_macros::debug_pin]
pub async fn infer_data_from_files(
profile: Profile,

View File

@@ -20,12 +20,12 @@ pub struct Tags {
}
impl Tags {
#[tracing::instrument]
#[tracing::instrument(skip(io_semaphore, fetch_semaphore))]
#[theseus_macros::debug_pin]
pub async fn init(
dirs: &DirectoryInfo,
io_semaphore: &IoSemaphore,
fetch_sempahore: &FetchSemaphore,
fetch_semaphore: &FetchSemaphore,
) -> crate::Result<Self> {
let mut tags = None;
let tags_path = dirs.caches_meta_dir().join("tags.json");
@@ -34,7 +34,7 @@ impl Tags {
{
tags = Some(tags_json);
} else {
match Self::fetch(fetch_sempahore).await {
match Self::fetch(fetch_semaphore).await {
Ok(tags_fetch) => tags = Some(tags_fetch),
Err(err) => {
tracing::warn!("Unable to fetch launcher tags: {err}")