Allow to run basic binary verification with "--test" (#147)

This commit is contained in:
Jesse Chan 2021-04-01 00:09:10 +08:00 committed by GitHub
parent 521517902b
commit cc13355f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import yargs from 'yargs';
import { hostPlatform, hostArch } from './system';
import { log } from './log';
import { need } from './index';
import { verify } from './verify';
import { version } from '../package.json';
async function main() {
@ -13,6 +14,7 @@ async function main() {
.option('node-range', { alias: 'n', default: 'latest', type: 'string' })
.option('platform', { alias: 'p', default: hostPlatform, type: 'string' })
.option('arch', { alias: 'a', default: hostArch, type: 'string' })
.option('test', { alias: 't', type: 'boolean' })
.option('force-fetch', {
alias: 'f',
type: 'boolean',
@ -31,6 +33,7 @@ async function main() {
'node-range': nodeRange,
platform,
arch,
test,
'force-fetch': forceFetch,
'force-build': forceBuild,
} = argv;
@ -44,6 +47,10 @@ async function main() {
});
log.info(local);
if (test) {
await verify(local);
}
}
main().catch((error) => {