summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop/src/cli.ts
blob: 5a8875cf89388c88b198b95a0f45c00738df8bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { invoke } from "@tauri-apps/api/core"
import { message } from "@tauri-apps/plugin-dialog"

import { initI18n, t } from "./i18n"

export async function installCli(): Promise<void> {
  await initI18n()

  try {
    const path = await invoke<string>("install_cli")
    await message(t("desktop.cli.installed.message", { path }), { title: t("desktop.cli.installed.title") })
  } catch (e) {
    await message(t("desktop.cli.failed.message", { error: String(e) }), { title: t("desktop.cli.failed.title") })
  }
}