@@ -10,9 +10,10 @@ const testPath = __dirname.replace("\\", "/");
1010export const repoPath : string = path . join ( testPath , ".." , ".autopull" ) ;
1111
1212// Function to clone a specific PR's code from the Git repo
13- export function clonePR ( url : string , prNumber : number ) : void {
13+ export function clonePR ( url : string , prNumber : number ) : string {
1414 const prBranch = `pull/${ prNumber } /head` ;
15- const execOptions = { cwd : repoPath } ;
15+ const finalRepoPath = path . join ( repoPath , prNumber . toString ( ) ) ;
16+ const execOptions = { cwd : finalRepoPath } ;
1617 const outputFile : string = path . join ( execOptions . cwd , "stamp.txt" ) ;
1718 const existingData = getPRData ( outputFile ) ;
1819
@@ -21,10 +22,10 @@ export function clonePR(url: string, prNumber: number): void {
2122 `Previously downloaded spec repo does not match targeted prNumber ${ prNumber } or repo ${ url } `
2223 ) ;
2324
24- if ( fs . existsSync ( repoPath ) ) {
25- fs . removeSync ( repoPath ) ;
25+ if ( fs . existsSync ( finalRepoPath ) ) {
26+ fs . removeSync ( finalRepoPath ) ;
2627 }
27- fs . mkdirSync ( repoPath ) ;
28+ fs . mkdirSync ( finalRepoPath ) ;
2829
2930 try {
3031 if ( prNumber !== 0 ) {
@@ -44,6 +45,8 @@ export function clonePR(url: string, prNumber: number): void {
4445 `Previously downloaded spec repo matches the expected PR Number ${ prNumber } and repo ${ url } . Skipping re-clone.`
4546 ) ;
4647 }
48+
49+ return finalRepoPath ;
4750}
4851
4952function writePRData ( targetFile : string , data : PRData ) : void {
0 commit comments