From cb88a0fce74b88d08e889f3b8d95d989f52de6a2 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 4 May 2020 16:40:21 +0200 Subject: [PATCH] Display libexecdir --- dist/index.js | 14 ++++++++++---- src/gpg.ts | 5 +++++ src/main.ts | 9 +++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 689c0ba..989000f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1025,10 +1025,11 @@ function run() { core.info('📣 GnuPG info'); const version = yield gpg.getVersion(); const dirs = yield gpg.getDirs(); - core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`); - core.info(`Homedir : ${dirs.homedir}`); - core.info(`Datadir : ${dirs.datadir}`); - core.info(`Libdir : ${dirs.libdir}`); + core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`); + core.info(`Libdir : ${dirs.libdir}`); + core.info(`Libexecdir : ${dirs.libexecdir}`); + core.info(`Datadir : ${dirs.datadir}`); + core.info(`Homedir : ${dirs.homedir}`); core.info('🔮 Checking signing key...'); const privateKey = yield openpgp.readPrivateKey(process.env.SIGNING_KEY); core.debug(`Fingerprint : ${privateKey.fingerprint}`); @@ -1143,12 +1144,16 @@ exports.getDirs = () => __awaiter(void 0, void 0, void 0, function* () { throw new Error(res.stderr); } let libdir = ''; + let libexecdir = ''; let datadir = ''; let homedir = ''; for (let line of res.stdout.replace(/\r/g, '').trim().split(/\n/g)) { if (line.startsWith('libdir:')) { libdir = line.substr('libdir:'.length).replace('%3a', ':').trim(); } + else if (line.startsWith('libexecdir:')) { + libexecdir = line.substr('libexecdir:'.length).replace('%3a', ':').trim(); + } else if (line.startsWith('datadir:')) { datadir = line.substr('datadir:'.length).replace('%3a', ':').trim(); } @@ -1158,6 +1163,7 @@ exports.getDirs = () => __awaiter(void 0, void 0, void 0, function* () { } return { libdir: path.normalize(libdir), + libexecdir: path.normalize(libexecdir), datadir: path.normalize(datadir), homedir: path.normalize(homedir) }; diff --git a/src/gpg.ts b/src/gpg.ts index 8fa9c9d..5846d6c 100644 --- a/src/gpg.ts +++ b/src/gpg.ts @@ -14,6 +14,7 @@ export interface Version { export interface Dirs { libdir: string; + libexecdir: string; datadir: string; homedir: string; } @@ -51,12 +52,15 @@ export const getDirs = async (): Promise => { } let libdir: string = ''; + let libexecdir: string = ''; let datadir: string = ''; let homedir: string = ''; for (let line of res.stdout.replace(/\r/g, '').trim().split(/\n/g)) { if (line.startsWith('libdir:')) { libdir = line.substr('libdir:'.length).replace('%3a', ':').trim(); + } else if (line.startsWith('libexecdir:')) { + libexecdir = line.substr('libexecdir:'.length).replace('%3a', ':').trim(); } else if (line.startsWith('datadir:')) { datadir = line.substr('datadir:'.length).replace('%3a', ':').trim(); } else if (line.startsWith('homedir:')) { @@ -66,6 +70,7 @@ export const getDirs = async (): Promise => { return { libdir: path.normalize(libdir), + libexecdir: path.normalize(libexecdir), datadir: path.normalize(datadir), homedir: path.normalize(homedir) }; diff --git a/src/main.ts b/src/main.ts index b634783..e9966b2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,10 +13,11 @@ async function run(): Promise { core.info('📣 GnuPG info'); const version = await gpg.getVersion(); const dirs = await gpg.getDirs(); - core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`); - core.info(`Homedir : ${dirs.homedir}`); - core.info(`Datadir : ${dirs.datadir}`); - core.info(`Libdir : ${dirs.libdir}`); + core.info(`Version : ${version.gnupg} (libgcrypt ${version.libgcrypt})`); + core.info(`Libdir : ${dirs.libdir}`); + core.info(`Libexecdir : ${dirs.libexecdir}`); + core.info(`Datadir : ${dirs.datadir}`); + core.info(`Homedir : ${dirs.homedir}`); core.info('🔮 Checking signing key...'); const privateKey = await openpgp.readPrivateKey(process.env.SIGNING_KEY);