@@ -772,13 +772,7 @@ async function attemptLocalBuild() {
772
772
getLogger ( ) . info (
773
773
`CodeTransformation: downloaded clientInstructions with diff.patch at: ${ clientInstructionsPath } `
774
774
)
775
- const diffContents = await fs . readFileText ( clientInstructionsPath )
776
- // make sure diff.patch is not empty
777
- if ( diffContents . trim ( ) ) {
778
- await processClientInstructions ( jobId , clientInstructionsPath , artifactId )
779
- } else {
780
- getLogger ( ) . info ( 'CodeTransformation: diff.patch is empty, skipping client-side build for this iteration' )
781
- }
775
+ await processClientInstructions ( jobId , clientInstructionsPath , artifactId )
782
776
}
783
777
}
784
778
@@ -812,11 +806,18 @@ async function processClientInstructions(jobId: string, clientInstructionsPath:
812
806
const destinationPath = path . join ( os . tmpdir ( ) , `originalCopy_${ jobId } _${ artifactId } ` )
813
807
await extractOriginalProjectSources ( destinationPath )
814
808
getLogger ( ) . info ( `CodeTransformation: copied project to ${ destinationPath } ` )
815
- const diffModel = new DiffModel ( )
816
- diffModel . parseDiff ( clientInstructionsPath , path . join ( destinationPath , 'sources' ) , true )
817
- // show user the diff.patch
818
- const doc = await vscode . workspace . openTextDocument ( clientInstructionsPath )
819
- await vscode . window . showTextDocument ( doc , { viewColumn : vscode . ViewColumn . One } )
809
+ const diffContents = await fs . readFileText ( clientInstructionsPath )
810
+ if ( diffContents . trim ( ) ) {
811
+ const diffModel = new DiffModel ( )
812
+ diffModel . parseDiff ( clientInstructionsPath , path . join ( destinationPath , 'sources' ) , true )
813
+ // show user the diff.patch
814
+ const doc = await vscode . workspace . openTextDocument ( clientInstructionsPath )
815
+ await vscode . window . showTextDocument ( doc , { viewColumn : vscode . ViewColumn . One } )
816
+ } else {
817
+ // still need to set the project copy so that we can use it below
818
+ transformByQState . setProjectCopyFilePath ( path . join ( destinationPath , 'sources' ) )
819
+ getLogger ( ) . info ( `CodeTransformation: diff.patch is empty` )
820
+ }
820
821
await runClientSideBuild ( transformByQState . getProjectCopyFilePath ( ) , artifactId )
821
822
}
822
823
0 commit comments