From 088c6c17ac7b6076604fd3bc40287d4afda0d940 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 20 Feb 2024 10:11:02 -0500 Subject: Remove testMain (#711) --- dev/bin/build.js | 11 +++++------ dev/util.js | 13 ------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/dev/bin/build.js b/dev/bin/build.js index 7a954c66..26fbff07 100644 --- a/dev/bin/build.js +++ b/dev/bin/build.js @@ -26,7 +26,7 @@ import readline from 'readline'; import {parseArgs} from 'util'; import {buildLibs} from '../build-libs.js'; import {ManifestUtil} from '../manifest-util.js'; -import {getAllFiles, testMain} from '../util.js'; +import {getAllFiles} from '../util.js'; const dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -217,10 +217,8 @@ function ensureFilesExist(directory, files) { } } -/** - * @param {string[]} argv - */ -export async function main(argv) { +/** */ +export async function main() { /** @type {import('util').ParseArgsConfig['options']} */ const parseArgsConfigOptions = { all: { @@ -248,6 +246,7 @@ export async function main(argv) { } }; + const argv = process.argv.slice(2); const {values: args} = parseArgs({args: argv, options: parseArgsConfigOptions}); const dryRun = /** @type {boolean} */ (args.dryRun); @@ -280,4 +279,4 @@ export async function main(argv) { } } -await testMain(main, process.argv.slice(2)); +await main(); diff --git a/dev/util.js b/dev/util.js index 817b0d84..5a4c5788 100644 --- a/dev/util.js +++ b/dev/util.js @@ -92,16 +92,3 @@ export function createDictionaryArchive(dictionaryDirectory, dictionaryName) { // Return zipFileBlob; } - -/** - * @param {(...args: import('core').SafeAny[]) => (unknown|Promise)} func - * @param {...import('core').SafeAny} args - */ -export async function testMain(func, ...args) { - try { - await func(...args); - } catch (e) { - console.log(e); - process.exit(-1); - } -} -- cgit v1.2.3