fix: add more verbosity to validation (#747)

* fix: add more verbosity to validation

* fix: more verbosity on tests

* fix: use proper variable for sig
This commit is contained in:
Tom Hu
2022-05-31 11:29:46 -04:00
committed by GitHub
parent a2d3766e60
commit 95faa5a026
6 changed files with 27 additions and 8 deletions

View File

@@ -176,7 +176,7 @@ const buildExec = () => {
uploaderVersion = 'latest';
}
return {execArgs, options, failCi, os, uploaderVersion};
return {execArgs, options, failCi, os, uploaderVersion, verbose};
};
export default buildExec;

View File

@@ -18,7 +18,7 @@ import versionInfo from './version';
let failCi;
try {
const {execArgs, options, failCi, os, uploaderVersion} = buildExec();
const {execArgs, options, failCi, os, uploaderVersion, verbose} = buildExec();
const platform = getPlatform(os);
const filename = path.join( __dirname, getUploaderName(platform));
@@ -35,7 +35,7 @@ try {
}).on('finish', async () => {
filePath.close();
await verify(filename, platform, uploaderVersion);
await verify(filename, platform, uploaderVersion, verbose);
await versionInfo(platform, uploaderVersion);
await fs.chmodSync(filename, '777');

View File

@@ -16,6 +16,7 @@ const verify = async (
filename: string,
platform: string,
version: string,
verbose: boolean,
): Promise<void> => {
try {
const uploaderName = getUploaderName(platform);
@@ -32,11 +33,17 @@ const verify = async (
`${getBaseUrl(platform, version)}.SHA256SUM`,
);
const shasum = await shasumRes.text();
if (verbose) {
console.log(`Received SHA256SUM ${shasum}`);
}
const shaSigRes = await fetch.default(
`${getBaseUrl(platform, version)}.SHA256SUM.sig`,
);
const shaSig = await shaSigRes.text();
if (verbose) {
console.log(`Received SHA256SUM signature ${shaSig}`);
}
// Verify shasum
const verified = await openpgp.verify({