mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-26 02:26:19 +08:00
Fix dist download
This commit is contained in:
parent
2bf5eec3b6
commit
8e2fd532f1
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
@ -141,16 +141,18 @@ async function httpGetString(url: string): Promise<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function httpDownload(url: string, localPath: string): Promise<void> {
|
async function httpDownload(url: string, localPath: string): Promise<void> {
|
||||||
const writeStream = fs.createWriteStream(localPath)
|
|
||||||
try {
|
|
||||||
const response = await httpc.get(url)
|
const response = await httpc.get(url)
|
||||||
response.message.pipe(writeStream)
|
return new Promise<void>(function (resolve, reject) {
|
||||||
return new Promise<void>(function (resolve) {
|
const writeStream = fs.createWriteStream(localPath)
|
||||||
|
response.message
|
||||||
|
.pipe(writeStream)
|
||||||
|
.on('close', () => {
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
} finally {
|
.on('error', err => {
|
||||||
writeStream.close()
|
reject(err)
|
||||||
}
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function extractZip(zip: string, destination: string): Promise<void> {
|
async function extractZip(zip: string, destination: string): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user