3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-04-24 04:15:33 +00:00
This commit is contained in:
eric sciple 2019-12-10 01:42:25 -05:00
parent a039094e93
commit ba329ee889
2 changed files with 10 additions and 10 deletions

View file

@ -32,7 +32,7 @@ export async function downloadRepository(
// await fs.promises.writeFile(archivePath, raw)
// Get the archive URL using the REST API
let archiveUrl = retryHelper.execute(async () => {
await retryHelper.execute(async () => {
// Prepare the archive stream
core.debug(`Preparing the archive stream: ${archivePath}`)
await io.rmRF(archivePath)
@ -142,16 +142,16 @@ function downloadFile(url: string, fileStream: WriteStream): Promise<void> {
return
}
// response.on('data', chunk => {
// fileStream.write(chunk)
// })
response.on('data', chunk => {
fileStream.write(chunk)
})
response.on('end', () => {
resolve()
})
response.on('error', err => {
reject(err)
})
response.pipe(fileStream)
// response.pipe(fileStream)
})
} catch (err) {
reject(err)