From 896e2cbf0f3ef789193ebbb55ee66985369bac9f Mon Sep 17 00:00:00 2001 From: Anton Troshin Date: Tue, 19 Nov 2024 13:05:53 -0600 Subject: [PATCH] add logs Signed-off-by: Anton Troshin --- dist/setup/index.js | 20 +++++++++++--------- src/installer.ts | 2 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index a21c079..fff2f6c 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -88400,21 +88400,23 @@ function cacheWindowsDir(extPath, tool, version, arch) { }); // iterate through actual cache directory paths and make links if necessary for (const cachePath of actualCacheDirectoryPaths) { + core.info(`Trying to link ${cachePath.defaultPath} to ${cachePath.actualPath}`); if (!fs_1.default.existsSync(cachePath.actualPath)) { core.info(`Creating directory ${cachePath.actualPath}`); fs_1.default.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_1.default.readlinkSync(cachePath.defaultPath); - if (symlinkTarget !== "") { - core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`); - } - else { - fs_1.default.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_1.default.readlinkSync(cachePath.defaultPath); + core.info(`Symlink target: ${symlinkTarget}`); + if (symlinkTarget !== "") { + core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`); + } + else { + fs_1.default.symlinkSync(cachePath.actualPath, cachePath.defaultPath, 'junction'); + core.info(`Created link ${cachePath.defaultPath} => ${cachePath.actualPath}`); } } // make outer code to continue using toolcache as if it were installed on c: diff --git a/src/installer.ts b/src/installer.ts index ef7940e..f617662 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -234,6 +234,7 @@ async function cacheWindowsDir( // iterate through actual cache directory paths and make links if necessary for (const cachePath of actualCacheDirectoryPaths) { + core.info(`Trying to link ${cachePath.defaultPath} to ${cachePath.actualPath}`); if (!fs.existsSync(cachePath.actualPath)) { core.info(`Creating directory ${cachePath.actualPath}`); fs.mkdirSync(path.dirname(cachePath.actualPath), {recursive: true}); @@ -242,6 +243,7 @@ async function cacheWindowsDir( } // make sure the link is pointing to the actual cache directory const symlinkTarget = fs.readlinkSync(cachePath.defaultPath); + core.info(`Symlink target: ${symlinkTarget}`); if (symlinkTarget !== "") { core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`); } else {