2026-01-06 01:07:46 +08:00
|
|
|
import { message } from "@tauri-apps/plugin-dialog"
|
|
|
|
|
|
2026-01-28 05:00:17 +08:00
|
|
|
import { initI18n, t } from "./i18n"
|
2026-02-02 15:58:08 +08:00
|
|
|
import { commands } from "./bindings"
|
2026-01-28 05:00:17 +08:00
|
|
|
|
2026-01-06 01:07:46 +08:00
|
|
|
export async function installCli(): Promise<void> {
|
2026-01-28 05:00:17 +08:00
|
|
|
await initI18n()
|
|
|
|
|
|
2026-01-06 01:07:46 +08:00
|
|
|
try {
|
2026-02-02 15:58:08 +08:00
|
|
|
const path = await commands.installCli()
|
2026-01-28 05:00:17 +08:00
|
|
|
await message(t("desktop.cli.installed.message", { path }), { title: t("desktop.cli.installed.title") })
|
2026-01-06 01:07:46 +08:00
|
|
|
} catch (e) {
|
2026-01-28 05:00:17 +08:00
|
|
|
await message(t("desktop.cli.failed.message", { error: String(e) }), { title: t("desktop.cli.failed.title") })
|
2026-01-06 01:07:46 +08:00
|
|
|
}
|
|
|
|
|
}
|