mirror of
https://github.com/actions/setup-python.git
synced 2025-12-25 17:53:40 +00:00
minor changes
This commit is contained in:
parent
e8afe8a475
commit
5fe7a0b444
3 changed files with 24 additions and 15 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue