From f0ec7fb78035498a4744fb4620c3f208b5662ac9 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Thu, 18 Aug 2022 17:10:03 -0600 Subject: [PATCH] Remove 'followSymbolicLinks: false' flag for Globber It appears that when restoring the Gradle User Home directory, certain empty directories are being identified by Node as broken symlinks. This results in `Error: ENOENT: No such file or directory` when attempting to resolve a Glob pattern. By using the default behaviour of Globber (followSymbolicLinks && ignoreBrokenLinks), these bad files no longer cause errors when saving the Gradle User Home to cache. Fixes #408 --- src/cache-extract-entries.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cache-extract-entries.ts b/src/cache-extract-entries.ts index f764719..ee0c3ce 100644 --- a/src/cache-extract-entries.ts +++ b/src/cache-extract-entries.ts @@ -150,8 +150,7 @@ abstract class AbstractEntryExtractor { // Find all matching files for this cache entry definition const globber = await glob.create(pattern, { - implicitDescendants: false, - followSymbolicLinks: false + implicitDescendants: false }) const matchingFiles = await globber.glob() @@ -308,8 +307,7 @@ export class GradleHomeEntryExtractor extends AbstractEntryExtractor { private async deleteWrapperZips(): Promise { const wrapperZips = path.resolve(this.gradleUserHome, 'wrapper/dists/*/*/*.zip') const globber = await glob.create(wrapperZips, { - implicitDescendants: false, - followSymbolicLinks: false + implicitDescendants: false }) for (const wrapperZip of await globber.glob()) {