Upgrading (#354)

* fixed no download bug

* draft

* Working version

* minor improvements

* cicd fix

* merge conflicts

* fixed major merge confusion

* more conflicts, reformatting

* fixed random bugs found

* added second repair option to avoid confusion
This commit is contained in:
Wyatt Verchere
2023-07-26 20:33:03 -07:00
committed by GitHub
parent 70aaf6eef9
commit 21ae310f63
24 changed files with 817 additions and 306 deletions

View File

@@ -21,6 +21,9 @@ pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
profile_add_project_from_path,
profile_toggle_disable_project,
profile_remove_project,
profile_update_managed_modrinth,
profile_repair_managed_modrinth,
profile_is_managed_modrinth,
profile_run,
profile_run_wait,
profile_run_credentials,
@@ -105,7 +108,7 @@ pub async fn profile_install(path: ProfilePathId) -> Result<()> {
pub async fn profile_update_all(
path: ProfilePathId,
) -> Result<HashMap<ProjectPathId, ProjectPathId>> {
Ok(profile::update_all(&path).await?)
Ok(profile::update_all_projects(&path).await?)
}
/// Updates a specified project
@@ -162,6 +165,28 @@ pub async fn profile_remove_project(
Ok(())
}
// Updates a managed Modrinth profile
#[tauri::command]
pub async fn profile_update_managed_modrinth(
path: ProfilePathId,
) -> Result<()> {
Ok(profile::update::update_managed_modrinth(&path).await?)
}
// Repairs a managed Modrinth profile by updating it to the current version
#[tauri::command]
pub async fn profile_repair_managed_modrinth(
path: ProfilePathId,
) -> Result<()> {
Ok(profile::update::repair_managed_modrinth(&path).await?)
}
// Gets if a profile is managed by Modrinth
#[tauri::command]
pub async fn profile_is_managed_modrinth(path: ProfilePathId) -> Result<bool> {
Ok(profile::is_managed_modrinth_pack(&path).await?)
}
// Exports a profile to a .mrpack file (export_location should end in .mrpack)
// invoke('profile_export_mrpack')
#[tauri::command]