This commit is contained in:
Paul Merlin 2020-06-13 13:54:27 +02:00
parent 5c61ab77ec
commit 6cee865aea
6 changed files with 18 additions and 22 deletions

View file

@ -14,8 +14,8 @@ const gradleVersionsBaseUrl = 'https://services.gradle.org/versions'
/**
* @return Gradle executable path
*/
export async function gradleVersion(gradleVersion: string): Promise<string> {
switch (gradleVersion) {
export async function gradleVersion(version: string): Promise<string> {
switch (version) {
case 'current':
return gradleCurrent()
case 'rc':
@ -25,7 +25,7 @@ export async function gradleVersion(gradleVersion: string): Promise<string> {
case 'release-nightly':
return gradleReleaseNightly()
default:
return gradle(gradleVersion)
return gradle(version)
}
}
@ -129,9 +129,9 @@ async function httpGetJson(url: string): Promise<any> {
return JSON.parse(body)
}
async function httpDownload(url: string, path: string): Promise<void> {
async function httpDownload(url: string, localPath: string): Promise<void> {
return new Promise<void>(function (resolve, reject) {
const writeStream = fs.createWriteStream(path)
const writeStream = fs.createWriteStream(localPath)
httpc
.get(url)
.then(response => {