mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
minor changes
This commit is contained in:
parent
e8afe8a475
commit
5fe7a0b444
3 changed files with 24 additions and 15 deletions
12
dist/cache-save/index.js
vendored
12
dist/cache-save/index.js
vendored
|
@ -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
12
dist/setup/index.js
vendored
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
Reference in a new issue