mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-12-25 04:32:08 -05:00
create .gnupg home dir if it doesn't exist
This commit is contained in:
parent
e650e69265
commit
c2ed3a562b
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue