From 81e099a441c64be3833e77ab157cae5cc445b016 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Thu, 27 Aug 2026 19:38:58 -0400 Subject: [PATCH] fix(core): preserve benchmark directory argument (#45634) --- packages/core/script/benchmark-location.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/script/benchmark-location.ts b/packages/core/script/benchmark-location.ts index 60390db7725..dc29e5046e7 100644 --- a/packages/core/script/benchmark-location.ts +++ b/packages/core/script/benchmark-location.ts @@ -12,7 +12,9 @@ import { AbsolutePath } from "../src/schema" const args = process.argv.slice(2) const iterationsIndex = args.indexOf("--iterations") const iterations = iterationsIndex === -1 ? 10 : Number(args[iterationsIndex + 1]) -const directory = args.find((arg, index) => !arg.startsWith("--") && index !== iterationsIndex + 1) ?? process.cwd() +const directory = + args.find((arg, index) => !arg.startsWith("--") && (iterationsIndex === -1 || index !== iterationsIndex + 1)) ?? + process.cwd() if (!Number.isInteger(iterations) || iterations < 1) { console.error("--iterations must be a positive integer")