mirror of
				https://github.com/gradle/gradle-build-action.git
				synced 2025-11-04 09:58:56 +08:00 
			
		
		
		
	@@ -312,9 +312,9 @@ export class GradleHomeEntryExtractor extends AbstractEntryExtractor {
 | 
				
			|||||||
            followSymbolicLinks: false
 | 
					            followSymbolicLinks: false
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (const p of await globber.glob()) {
 | 
					        for (const wrapperZip of await globber.glob()) {
 | 
				
			||||||
            cacheDebug(`Deleting wrapper zip: ${p}`)
 | 
					            cacheDebug(`Deleting wrapper zip: ${wrapperZip}`)
 | 
				
			||||||
            tryDelete(p)
 | 
					            await tryDelete(wrapperZip)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -198,9 +198,12 @@ export function handleCacheFailure(error: unknown, message: string): void {
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
export async function tryDelete(file: string): Promise<void> {
 | 
					export async function tryDelete(file: string): Promise<void> {
 | 
				
			||||||
    const maxAttempts = 5
 | 
					    const maxAttempts = 5
 | 
				
			||||||
    const stat = fs.lstatSync(file)
 | 
					 | 
				
			||||||
    for (let attempt = 1; attempt <= maxAttempts; attempt++) {
 | 
					    for (let attempt = 1; attempt <= maxAttempts; attempt++) {
 | 
				
			||||||
 | 
					        if (!fs.existsSync(file)) {
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
					            const stat = fs.lstatSync(file)
 | 
				
			||||||
            if (stat.isDirectory()) {
 | 
					            if (stat.isDirectory()) {
 | 
				
			||||||
                fs.rmdirSync(file, {recursive: true})
 | 
					                fs.rmdirSync(file, {recursive: true})
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user