From c5e1979a6bbed91b46486c3fa794241a37603dcf Mon Sep 17 00:00:00 2001 From: Paul Merlin Date: Mon, 28 Oct 2019 13:26:37 +0100 Subject: [PATCH] Fix relative paths issues when using `build-root-directory` --- src/main.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 82f048f..93ddacb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,12 +40,12 @@ async function resolveGradleExecutable(baseDirectory: string): Promise { const gradleVersion = inputOrNull("gradle-version"); if (gradleVersion != null) { - return provision.gradleVersion(gradleVersion) + return path.resolve(provision.gradleVersion(gradleVersion)) } const gradleExecutable = inputOrNull("gradle-executable"); if (gradleExecutable != null) { - return path.join(baseDirectory, gradleExecutable) + return path.resolve(baseDirectory, gradleExecutable) } const wrapperDirectory = inputOrNull("wrapper-directory"); @@ -53,13 +53,15 @@ async function resolveGradleExecutable(baseDirectory: string): Promise { ? path.join(baseDirectory, wrapperDirectory) : baseDirectory; - return path.join(executableDirectory, gradlew.wrapperFilename()); + return path.resolve(executableDirectory, gradlew.wrapperFilename()); } function resolveBuildRootDirectory(baseDirectory: string): string { let buildRootDirectory = inputOrNull("build-root-directory"); - return buildRootDirectory == null ? baseDirectory : path.join(baseDirectory, buildRootDirectory); + return buildRootDirectory == null + ? path.resolve(baseDirectory) + : path.resolve(baseDirectory, buildRootDirectory); }