mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 08:11:07 -05:00
Fix relative paths issues when using build-root-directory
This commit is contained in:
parent
dc882d2669
commit
c5e1979a6b
1 changed files with 6 additions and 4 deletions
10
src/main.ts
10
src/main.ts
|
@ -40,12 +40,12 @@ async function resolveGradleExecutable(baseDirectory: string): Promise<string> {
|
||||||
|
|
||||||
const gradleVersion = inputOrNull("gradle-version");
|
const gradleVersion = inputOrNull("gradle-version");
|
||||||
if (gradleVersion != null) {
|
if (gradleVersion != null) {
|
||||||
return provision.gradleVersion(gradleVersion)
|
return path.resolve(provision.gradleVersion(gradleVersion))
|
||||||
}
|
}
|
||||||
|
|
||||||
const gradleExecutable = inputOrNull("gradle-executable");
|
const gradleExecutable = inputOrNull("gradle-executable");
|
||||||
if (gradleExecutable != null) {
|
if (gradleExecutable != null) {
|
||||||
return path.join(baseDirectory, gradleExecutable)
|
return path.resolve(baseDirectory, gradleExecutable)
|
||||||
}
|
}
|
||||||
|
|
||||||
const wrapperDirectory = inputOrNull("wrapper-directory");
|
const wrapperDirectory = inputOrNull("wrapper-directory");
|
||||||
|
@ -53,13 +53,15 @@ async function resolveGradleExecutable(baseDirectory: string): Promise<string> {
|
||||||
? path.join(baseDirectory, wrapperDirectory)
|
? path.join(baseDirectory, wrapperDirectory)
|
||||||
: baseDirectory;
|
: baseDirectory;
|
||||||
|
|
||||||
return path.join(executableDirectory, gradlew.wrapperFilename());
|
return path.resolve(executableDirectory, gradlew.wrapperFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function resolveBuildRootDirectory(baseDirectory: string): string {
|
function resolveBuildRootDirectory(baseDirectory: string): string {
|
||||||
let buildRootDirectory = inputOrNull("build-root-directory");
|
let buildRootDirectory = inputOrNull("build-root-directory");
|
||||||
return buildRootDirectory == null ? baseDirectory : path.join(baseDirectory, buildRootDirectory);
|
return buildRootDirectory == null
|
||||||
|
? path.resolve(baseDirectory)
|
||||||
|
: path.resolve(baseDirectory, buildRootDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue