more logs and logic change

Signed-off-by: Anton Troshin <anton@diagrid.io>
This commit is contained in:
Anton Troshin 2024-11-19 16:51:26 -06:00
parent f8cf508b5f
commit e3c077dd6d
No known key found for this signature in database
GPG key ID: 9F8A96ACA9EB6363
2 changed files with 16 additions and 6 deletions

11
dist/setup/index.js vendored
View file

@ -88402,12 +88402,17 @@ function cacheWindowsDir(extPath, tool, version, arch) {
for (const cachePath of actualCacheDirectoryPaths) {
core.info(`Trying to link ${cachePath.defaultPath} to ${cachePath.actualPath}`);
try {
if (!fs_1.default.existsSync(cachePath.defaultPath)) {
core.info(`Default path ${cachePath.defaultPath} does not exist`);
core.info(`Creating directory ${cachePath.defaultPath}`);
fs_1.default.mkdirSync(cachePath.defaultPath, { recursive: true });
}
if (!fs_1.default.existsSync(cachePath.actualPath)) {
core.info(`Creating directory ${cachePath.actualPath}`);
fs_1.default.mkdirSync(path.dirname(cachePath.actualPath), { recursive: true });
core.info(`Actual path ${cachePath.actualPath} does not exist. Safe to create symlink`);
}
else {
core.info(`Directory ${cachePath.actualPath} already exists`);
core.info(`Actual path ${cachePath.actualPath} already exists. Skipping symlink creation`);
continue;
}
// check if the default path is a symlink
const isSymlink = fs_1.default.lstatSync(cachePath.defaultPath).isSymbolicLink();

View file

@ -236,11 +236,16 @@ async function cacheWindowsDir(
for (const cachePath of actualCacheDirectoryPaths) {
core.info(`Trying to link ${cachePath.defaultPath} to ${cachePath.actualPath}`);
try {
if (!fs.existsSync(cachePath.defaultPath)) {
core.info(`Default path ${cachePath.defaultPath} does not exist`);
core.info(`Creating directory ${cachePath.defaultPath}`);
fs.mkdirSync(cachePath.defaultPath, {recursive: true});
}
if (!fs.existsSync(cachePath.actualPath)) {
core.info(`Creating directory ${cachePath.actualPath}`);
fs.mkdirSync(path.dirname(cachePath.actualPath), {recursive: true});
core.info(`Actual path ${cachePath.actualPath} does not exist. Safe to create symlink`);
} else {
core.info(`Directory ${cachePath.actualPath} already exists`);
core.info(`Actual path ${cachePath.actualPath} already exists. Skipping symlink creation`);
continue;
}
// check if the default path is a symlink