mirror of
https://github.com/gradle/actions
synced 2024-11-27 20:02:19 +00:00
Make Gradle Home detection compatible with MacOS
MacOS runners are initialized with a Gradle User Home directory including the `~/.gradle/notifications` directory. This was causing the action to skip restoring the Gradle User Home on MacOS. This fix limits the pre-existing GUH check to the `~/.gradle/caches` directory which isn't pre-initialized in the runner. Fixes #155
This commit is contained in:
parent
800e52f373
commit
53e57a851c
1 changed files with 4 additions and 6 deletions
|
@ -102,12 +102,10 @@ export class GradleStateCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
cacheOutputExists(): boolean {
|
cacheOutputExists(): boolean {
|
||||||
const paths = this.getCachePath()
|
const cachesDir = path.resolve(this.gradleUserHome, 'caches')
|
||||||
for (const p of paths) {
|
if (fs.existsSync(cachesDir)) {
|
||||||
if (fs.existsSync(p)) {
|
cacheDebug(`Cache output exists at ${cachesDir}`)
|
||||||
cacheDebug(`Cache output exists at ${p}`)
|
return true
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue