| 137 | |
| 138 | #[tauri::command] |
| 139 | fn compiler_install(setup: Id) -> CompilerInstallResult { |
| 140 | trace!("compiler_install: <- {}", setup); |
| 141 | let result = if let Some(install) = setup.install { |
| 142 | match install() { |
| 143 | Ok(_) => return CompilerInstallResult::Ok, |
| 144 | Err(e) => { |
| 145 | return CompilerInstallResult::Err { |
| 146 | message: e.to_string(), |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | } else { |
| 151 | CompilerInstallResult::Err { |
| 152 | message: "该编译器没有安装方法".into(), |
| 153 | } |
| 154 | }; |
| 155 | trace!("compiler_install: -> {:?}", result); |
| 156 | result |
| 157 | } |
| 158 | |
| 159 | #[tauri::command] |
| 160 | fn workspace_verify(path: String) -> VerifyResult { |