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

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;
}