Skip to content

Commit

Permalink
create .gnupg home dir if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Jun 25, 2023
1 parent e650e69 commit c2ed3a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gpg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ export const getKeygrip = async (fingerprint: string): Promise<string> => {
};

export const configureAgent = async (config: string): Promise<void> => {
const gpgAgentConf = path.join(await getGnupgHome(), 'gpg-agent.conf');
const gnupgHomeDir = await getGnupgHome();
if (!fs.existsSync(gnupgHomeDir)) {
fs.mkdirSync(gnupgHomeDir, {recursive: true});
}
const gpgAgentConf = path.join(gnupgHomeDir, 'gpg-agent.conf');
await fs.writeFile(gpgAgentConf, config, function (err) {
if (err) throw err;
});
Expand Down

0 comments on commit c2ed3a5

Please sign in to comment.