minor changes

This commit is contained in:
Dmitry Shibanov 2021-09-15 00:14:44 +03:00
parent e8afe8a475
commit 5fe7a0b444
3 changed files with 24 additions and 15 deletions

View file

@ -35052,7 +35052,12 @@ class CacheDistributor {
if (stderr) {
throw new Error(`failed to procceed with caching with error: ${exitCode}`);
}
return [stdout];
let resolvedPath = stdout;
if (stdout.includes('~')) {
resolvedPath = path.join(os.homedir(), stdout.slice(1));
}
core.info(`global cache directory path is ${resolvedPath}`);
return [resolvedPath];
});
}
computePrimaryKey() {
@ -35063,10 +35068,7 @@ class CacheDistributor {
}
isCacheDirectoryExists(cacheDirectory) {
const result = cacheDirectory.reduce((previousValue, currentValue) => {
const resolvePath = currentValue.includes('~')
? path.join(os.homedir(), currentValue.slice(1))
: currentValue;
return previousValue || fs.existsSync(resolvePath);
return previousValue || fs.existsSync(currentValue);
}, false);
return result;
}

12
dist/setup/index.js vendored
View file

@ -36821,7 +36821,12 @@ class CacheDistributor {
if (stderr) {
throw new Error(`failed to procceed with caching with error: ${exitCode}`);
}
return [stdout];
let resolvedPath = stdout;
if (stdout.includes('~')) {
resolvedPath = path.join(os.homedir(), stdout.slice(1));
}
core.info(`global cache directory path is ${resolvedPath}`);
return [resolvedPath];
});
}
computePrimaryKey() {
@ -36832,10 +36837,7 @@ class CacheDistributor {
}
isCacheDirectoryExists(cacheDirectory) {
const result = cacheDirectory.reduce((previousValue, currentValue) => {
const resolvePath = currentValue.includes('~')
? path.join(os.homedir(), currentValue.slice(1))
: currentValue;
return previousValue || fs.existsSync(resolvePath);
return previousValue || fs.existsSync(currentValue);
}, false);
return result;
}

View file

@ -29,7 +29,15 @@ abstract class CacheDistributor {
);
}
return [stdout];
let resolvedPath = stdout;
if (stdout.includes('~')) {
resolvedPath = path.join(os.homedir(), stdout.slice(1));
}
core.info(`global cache directory path is ${resolvedPath}`);
return [resolvedPath];
}
protected async computePrimaryKey() {
@ -39,10 +47,7 @@ abstract class CacheDistributor {
protected isCacheDirectoryExists(cacheDirectory: string[]) {
const result = cacheDirectory.reduce((previousValue, currentValue) => {
const resolvePath = currentValue.includes('~')
? path.join(os.homedir(), currentValue.slice(1))
: currentValue;
return previousValue || fs.existsSync(resolvePath);
return previousValue || fs.existsSync(currentValue);
}, false);
return result;