add cli.ts
This commit is contained in:
parent
a6e7906e20
commit
54fd85694d
7
cli.ts
Executable file
7
cli.ts
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env -S deno run --allow-run --allow-read
|
||||||
|
import { showZenityUI } from "./ui/zenity.ts";
|
||||||
|
|
||||||
|
if (import.meta.main) {
|
||||||
|
// TODO fall back on terminal UI if zenity is not available
|
||||||
|
await showZenityUI();
|
||||||
|
}
|
|
@ -37,6 +37,7 @@ async function readPrivateKey(): Promise<string> {
|
||||||
return config.privateKey;
|
return config.privateKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function showZenityUI(): Promise<void> {
|
||||||
const privateKey = await readPrivateKey();
|
const privateKey = await readPrivateKey();
|
||||||
const siteTag = await askInput("site tag:");
|
const siteTag = await askInput("site tag:");
|
||||||
let password = await askInput("password:", true);
|
let password = await askInput("password:", true);
|
||||||
|
@ -53,3 +54,4 @@ if (result) {
|
||||||
} else {
|
} else {
|
||||||
await showMessage(`Error in hashing password`);
|
await showMessage(`Error in hashing password`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue