|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|