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

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

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

  try {
    const path = await commands.installCli()
    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") })
  }
}