fix for config file in home config
This commit is contained in:
parent
54fd85694d
commit
0fb07099a2
2 changed files with 10 additions and 2 deletions
2
cli.ts
2
cli.ts
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env -S deno run --allow-run --allow-read
|
||||
#!/usr/bin/env -S deno run --allow-run --allow-read --allow-env
|
||||
import { showZenityUI } from "./ui/zenity.ts";
|
||||
|
||||
if (import.meta.main) {
|
||||
|
|
10
ui/zenity.ts
10
ui/zenity.ts
|
@ -32,7 +32,15 @@ async function copyToClipboard(text: string): Promise<void> {
|
|||
}
|
||||
|
||||
async function readPrivateKey(): Promise<string> {
|
||||
const content = await Deno.readTextFile(".local/config.json");
|
||||
let content: string;
|
||||
try {
|
||||
content = await Deno.readTextFile(".local/config.json");
|
||||
} catch {
|
||||
content = await Deno.readTextFile(
|
||||
`${Deno.env.get("HOME")}/.config/thunderk-passwordhash.json`,
|
||||
);
|
||||
}
|
||||
|
||||
const config = JSON.parse(content);
|
||||
return config.privateKey;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue