From e9c274b4514421aba8ad0259d08bec55bd956176 Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Sat, 23 Nov 2024 16:55:57 -0500 Subject: [PATCH] chore: remove console.warn from ./scripts/bench-file script --- scripts/bench-file/src/main.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/bench-file/src/main.ts b/scripts/bench-file/src/main.ts index 93df81a7..cb8b9afe 100644 --- a/scripts/bench-file/src/main.ts +++ b/scripts/bench-file/src/main.ts @@ -14,20 +14,19 @@ async function main() { const rootDir = new URL('../../../', import.meta.url).pathname const scriptDir = new URL('../', import.meta.url).pathname const nodeModulesDir = path.join(rootDir, 'node_modules') + const vitestDir = path.join(nodeModulesDir, 'vitest') // If the root node_modules directory doesn't contain vitest, link // it to the vitest installed for this script. - fs.mkdirSync(nodeModulesDir, { recursive: true }) - try { + if (!fs.existsSync(vitestDir)) { + fs.mkdirSync(nodeModulesDir, { recursive: true }) fs.symlinkSync( path.relative( nodeModulesDir, path.join(scriptDir, 'node_modules/vitest'), ), - path.join(nodeModulesDir, 'vitest'), + vitestDir, ) - } catch (e) { - console.warn(e) } const vitest = await createVitest('benchmark', {