Misc bugs 4 (#381)

* bug fixes

* fixed jres being undetected

* cleanup

* prettier

* fixed folders not displaying windows exporting

* fixes, more bugs

* missed function

* clippy, fmt

* prettier
This commit is contained in:
Wyatt Verchere
2023-07-28 19:56:49 -07:00
committed by GitHub
parent 744d11f09e
commit 87449f91c3
22 changed files with 171 additions and 78 deletions

View File

@@ -12,6 +12,7 @@ pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
profile_remove,
profile_get,
profile_get_optimal_jre_key,
profile_get_full_path,
profile_list,
profile_check_installed,
profile_install,
@@ -55,6 +56,14 @@ pub async fn profile_get(
Ok(res)
}
// Get a profile's full path
// invoke('plugin:profile|profile_get_full_path',path)
#[tauri::command]
pub async fn profile_get_full_path(path: ProfilePathId) -> Result<PathBuf> {
let res = profile::get_full_path(&path).await?;
Ok(res)
}
// Get optimal java version from profile
#[tauri::command]
pub async fn profile_get_optimal_jre_key(

View File

@@ -59,7 +59,7 @@ pub fn show_in_folder(path: String) -> Result<()> {
#[cfg(target_os = "windows")]
{
Command::new("explorer")
.args(["/select,", &path]) // The comma after select is not a typo
.args([&path]) // The comma after select is not a typo
.spawn()?;
}
@@ -86,7 +86,7 @@ pub fn show_in_folder(path: String) -> Result<()> {
#[cfg(target_os = "macos")]
{
Command::new("open").args(["-R", &path]).spawn()?;
Command::new("open").args([&path]).spawn()?;
}
Ok::<(), theseus::Error>(())