From 430dc5d2af9c6dca34a11defe7797f9f8cfd09c8 Mon Sep 17 00:00:00 2001 From: Jared Petersen Date: Tue, 12 May 2020 01:14:29 -0700 Subject: [PATCH] specified homedir in executable --- src/auth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index e0dd6534..0a647a22 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -9,6 +9,7 @@ import {create as xmlCreate} from 'xmlbuilder2'; export const M2_DIR = '.m2'; export const TEMP_DIR = util.getTempDir(); +export const GPG_HOME_DIR = path.join(TEMP_DIR, '.gnupg'); export const SETTINGS_FILE = 'settings.xml'; export const PRIVATE_KEY_FILE = 'private-key.asc'; @@ -123,7 +124,7 @@ async function remove(path: string) { async function importGPG(gpgPrivateKey: string) { await write(TEMP_DIR, PRIVATE_KEY_FILE, gpgPrivateKey); - await exec.exec('gpg', ['--import', '--batch', PRIVATE_KEY_FILE], { + await exec.exec('gpg', ['--homedir', GPG_HOME_DIR, '--import', '--batch', PRIVATE_KEY_FILE], { cwd: TEMP_DIR }); await remove(path.join(TEMP_DIR, PRIVATE_KEY_FILE));