feat: start checks

This commit is contained in:
2025-03-16 17:55:38 +00:00
parent 08d6a2a2fe
commit 8d55e92fc9
26 changed files with 456 additions and 211 deletions

View File

@ -59,17 +59,30 @@ impl AnyProfile {
}
}
}
pub fn pkgs(&self) -> &BTreeSet<PkgKey> {
pub fn mod_pkgs(&self) -> &BTreeSet<PkgKey> {
match self {
Self::OngekiProfile(p) => &p.mods
}
}
pub fn pkgs_mut(&mut self) -> &mut BTreeSet<PkgKey> {
pub fn mod_pkgs_mut(&mut self) -> &mut BTreeSet<PkgKey> {
match self {
Self::OngekiProfile(p) => &mut p.mods
}
}
pub fn special_pkgs(&self) -> Vec<PkgKey> {
let mut res = Vec::new();
match self {
Self::OngekiProfile(p) => {
if let Some(hook) = &p.sgt.hook {
res.push(hook.clone());
}
if let Some(io) = &p.sgt.io {
res.push(io.clone());
}
}
}
res
}
pub async fn line_up(&self, pkg_hash: String, _app: AppHandle) -> Result<()> {
match self {
Self::OngekiProfile(_p) => {
@ -80,7 +93,7 @@ impl AnyProfile {
#[cfg(target_os = "windows")]
if let Some(info) = info {
use crate::model::config::Display;
use crate::model::profile::Display;
if res.is_ok() {
Display::wait_for_exit(_app, info);
} else {
@ -141,6 +154,14 @@ impl AnyProfile {
}
}
impl std::fmt::Debug for AnyProfile {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::OngekiProfile(p) => f.debug_tuple("ongeki").field(&p.name).finish(),
}
}
}
pub async fn list_profiles() -> Result<Vec<ProfileMeta>> {
let path = std::fs::read_dir(util::config_dir())?;