Display libexecdir

This commit is contained in:
CrazyMax 2020-05-04 16:40:21 +02:00
parent c263b24136
commit cb88a0fce7
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 20 additions and 8 deletions

10
dist/index.js generated vendored
View file

@ -1026,9 +1026,10 @@ function run() {
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(`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)
};

View file

@ -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<Dirs> => {
}
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<Dirs> => {
return {
libdir: path.normalize(libdir),
libexecdir: path.normalize(libexecdir),
datadir: path.normalize(datadir),
homedir: path.normalize(homedir)
};

View file

@ -14,9 +14,10 @@ async function run(): Promise<void> {
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(`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);