mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 17:12:51 +00:00
Lint 3
This commit is contained in:
parent
1647b85e82
commit
4a9a0a05a3
2 changed files with 11 additions and 19 deletions
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -141,24 +141,16 @@ 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> {
|
||||||
return new Promise<void>(function (resolve, reject) {
|
const writeStream = fs.createWriteStream(localPath)
|
||||||
const writeStream = fs.createWriteStream(localPath)
|
try {
|
||||||
httpc
|
const response = await httpc.get(url)
|
||||||
.get(url)
|
response.message.pipe(writeStream)
|
||||||
.then(response => {
|
return new Promise<void>(function (resolve) {
|
||||||
response.message
|
resolve()
|
||||||
.pipe(writeStream)
|
})
|
||||||
.on('close', () => {
|
} finally {
|
||||||
resolve()
|
writeStream.close()
|
||||||
})
|
}
|
||||||
.on('error', err => {
|
|
||||||
reject(err)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(reason => {
|
|
||||||
reject(reason)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function extractZip(zip: string, destination: string): Promise<void> {
|
async function extractZip(zip: string, destination: string): Promise<void> {
|
||||||
|
|
Loading…
Reference in a new issue