File tree Expand file tree Collapse file tree 5 files changed +25
-1
lines changed
Expand file tree Collapse file tree 5 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "repoUrl": "https://github.com/CodebuffAI/codebuff",
33 "generationDate": "2025-08-17T02:05:02.152Z",
4+ "initCommand": "bun install",
45 "evalCommits": [
56 {
67 "sha": "456858ccc77ebfeb400ef12bcf9dd167470a6639",
24252426 ]
24262427 }
24272428 ]
2428- }
2429+ }
Original file line number Diff line number Diff line change @@ -419,6 +419,7 @@ export async function runGitEvals(
419419 testRepoName ,
420420 evalCommit . sha ,
421421 true ,
422+ evalData . initCommand ,
422423 )
423424
424425 console . log (
Original file line number Diff line number Diff line change @@ -167,6 +167,8 @@ async function runSingleEvalTask(options: {
167167 evalData . repoUrl ,
168168 testRepoName ,
169169 evalCommit . sha ,
170+ undefined ,
171+ evalData . initCommand ,
170172 )
171173 console . log ( `Repository cloned to: ${ projectPath } ` )
172174
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export async function setupTestRepo(
4040 customRepoName : string ,
4141 commitSha : string = 'HEAD' ,
4242 addRandomSuffix : boolean = false ,
43+ initCommand ?: string ,
4344) : Promise < string > {
4445 const repoName = customRepoName || extractRepoNameFromUrl ( repoUrl )
4546 console . log ( `Setting up test repository: ${ repoName } ...` )
@@ -178,6 +179,24 @@ export async function setupTestRepo(
178179
179180 console . log ( `Repository has ${ commitCount } commits in history` )
180181
182+ try {
183+ if ( initCommand ) {
184+ console . log ( `Executing initialization command: ${ initCommand } ` )
185+ const [ command , ...args ] = initCommand . split ( ' ' )
186+ execFileSync ( command , args , {
187+ cwd : repoDir ,
188+ stdio : 'inherit' ,
189+ timeout : 240_000 , // 4 minute timeout for init commands
190+ } )
191+ console . log ( 'Initialization command completed successfully' )
192+ }
193+ } catch ( error ) {
194+ console . error ( 'Error executing initialization command:' , error )
195+ throw new Error (
196+ `Initialization command failed: ${ error instanceof Error ? error . message : String ( error ) } ` ,
197+ )
198+ }
199+
181200 console . log ( 'Repository verification passed' )
182201
183202 return repoDir
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export interface EvalData {
2020 repoUrl : string // URL of the git repository to clone
2121 testRepoName ?: string // Optional - can be inferred from repoUrl
2222 generationDate : string
23+ initCommand ?: string // Optional command to run during scaffolding setup
2324 evalCommits : EvalCommit [ ]
2425}
2526
You can’t perform that action at this time.
0 commit comments