mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-30 01:22:07 +00:00
fix(core): preserve benchmark directory argument (#45634)
This commit is contained in:
parent
498436f225
commit
81e099a441
1 changed files with 3 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue