mirror of
https://code.forgejo.org/actions/checkout.git
synced 2024-11-23 06:20:59 -05:00
.
This commit is contained in:
parent
64fcc0c59a
commit
a039094e93
2 changed files with 8 additions and 6 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
@ -8464,15 +8464,16 @@ function downloadFile(url, fileStream) {
|
||||||
response.resume(); // Consume response data to free up memory
|
response.resume(); // Consume response data to free up memory
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
response.on('data', chunk => {
|
// response.on('data', chunk => {
|
||||||
fileStream.write(chunk);
|
// fileStream.write(chunk)
|
||||||
});
|
// })
|
||||||
response.on('end', () => {
|
response.on('end', () => {
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
response.on('error', err => {
|
response.on('error', err => {
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
|
response.pipe(fileStream);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
@ -142,15 +142,16 @@ function downloadFile(url: string, fileStream: WriteStream): Promise<void> {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
response.on('data', chunk => {
|
// response.on('data', chunk => {
|
||||||
fileStream.write(chunk)
|
// fileStream.write(chunk)
|
||||||
})
|
// })
|
||||||
response.on('end', () => {
|
response.on('end', () => {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
response.on('error', err => {
|
response.on('error', err => {
|
||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
|
response.pipe(fileStream)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
reject(err)
|
reject(err)
|
||||||
|
|
Loading…
Reference in a new issue