From 80478497870529611dbb0dcc64b9bac372e95fe3 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Wed, 11 Dec 2024 16:43:24 -0500 Subject: [PATCH] fixup! Provide a meaningful error when CWD does not exist --- shared/install/macos.js | 9 ++++++--- tsconfig.json | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/shared/install/macos.js b/shared/install/macos.js index 7605c26..0aa1a5e 100644 --- a/shared/install/macos.js +++ b/shared/install/macos.js @@ -30,12 +30,15 @@ const PLUGIN_TRIPLET_IDENTIFIER = 'ausp atdg BOCU'; * Execute the "exec" method from the built-in `child_process` module. In the * event of failure due to the absence of the specified current working * directory, provide a meaningful error description. + * + * @param {string} command + * @param {ExecOptions} [options] */ -const exec = async (...args) => { +const exec = async (command, options) => { try { - return await promisify(_exec)(...args); + return await promisify(_exec)(command, options); } catch (error) { - const cwd = args[1]?.cwd || process.cwd(); + const cwd = options?.cwd || process.cwd(); const cwdExists = !!(await fs.stat(cwd).catch(() => null)); if (error.code === 'ENOENT' && !cwdExists) { diff --git a/tsconfig.json b/tsconfig.json index 0c65130..f7db582 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,9 @@ { "compilerOptions": { "checkJs": true, - "noEmit": true + "module": "commonjs", + "noEmit": true, + "target": "es2022" }, "include": ["shared", "test"] }