Skip to content

Commit a1fb08a

Browse files
committed
More progress
1 parent 689e104 commit a1fb08a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

benchmark/apps/cli/src/index.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ const run = async (toolbox: GluegunToolbox) => {
5757
throw new Error(`Exercise is invalid: ${exercise}`)
5858
}
5959

60-
console.log(await execa({ cwd: exercisesPath })`git checkout -f`)
61-
console.log(await execa({ cwd: exercisesPath })`git clean -fd`)
62-
6360
const id = config.runId ? Number(config.runId) : undefined
6461
let run: Run
6562

@@ -96,6 +93,15 @@ const run = async (toolbox: GluegunToolbox) => {
9693
throw new Error("No tasks found.")
9794
}
9895

96+
console.log(await execa({ cwd: exercisesPath })`git checkout -f`)
97+
console.log(await execa({ cwd: exercisesPath })`git clean -fd`)
98+
console.log(await execa({ cwd: exercisesPath })`git checkout -b runs/${run.id} main`)
99+
100+
fs.writeFileSync(
101+
path.resolve(exercisesPath, "settings.json"),
102+
JSON.stringify({ ...rooCodeDefaults, ...run.settings }, null, 2),
103+
)
104+
99105
const server = new IpcServer(run.socketPath, () => {})
100106
server.listen()
101107

@@ -146,6 +152,9 @@ const run = async (toolbox: GluegunToolbox) => {
146152
if (parentPid) {
147153
console.log(await execa`kill -INT ${parentPid}`)
148154
}
155+
156+
console.log(await execa({ cwd: exercisesPath })`git add .`)
157+
console.log(await execa({ cwd: exercisesPath })`git commit -m ${`Run #${run.id}`} --no-verify`)
149158
}
150159

151160
const runExercise = async ({ run, task, server }: { run: Run; task: Task; server: IpcServer }) => {

0 commit comments

Comments
 (0)