From fd3fcb34ee39ab9729bba70e064c6c55cca83950 Mon Sep 17 00:00:00 2001 From: Anton Troshin Date: Tue, 19 Nov 2024 12:28:31 -0600 Subject: [PATCH] move symlink check Signed-off-by: Anton Troshin --- src/installer.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index dc66e01..ef7940e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -239,16 +239,16 @@ async function cacheWindowsDir( fs.mkdirSync(path.dirname(cachePath.actualPath), {recursive: true}); } else { core.info(`Directory ${cachePath.actualPath} already exists`); - // make sure the link is pointing to the actual cache directory - const symlinkTarget = fs.readlinkSync(cachePath.defaultPath); - if (symlinkTarget !== "") { - core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`); - } else { - fs.symlinkSync(cachePath.actualPath, cachePath.defaultPath, 'junction'); - core.info( - `Created link ${cachePath.defaultPath} => ${cachePath.actualPath}` - ); - } + } + // make sure the link is pointing to the actual cache directory + const symlinkTarget = fs.readlinkSync(cachePath.defaultPath); + if (symlinkTarget !== "") { + core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`); + } else { + fs.symlinkSync(cachePath.actualPath, cachePath.defaultPath, 'junction'); + core.info( + `Created link ${cachePath.defaultPath} => ${cachePath.actualPath}` + ); } }