mirror of
https://github.com/actions/setup-python.git
synced 2025-04-20 03:53:30 +00:00
add fix
This commit is contained in:
parent
b44d7a8d91
commit
bed7d19f37
9
dist/cache-save/index.js
vendored
9
dist/cache-save/index.js
vendored
@ -35036,6 +35036,8 @@ const cache = __importStar(__webpack_require__(692));
|
|||||||
const glob = __importStar(__webpack_require__(281));
|
const glob = __importStar(__webpack_require__(281));
|
||||||
const core = __importStar(__webpack_require__(470));
|
const core = __importStar(__webpack_require__(470));
|
||||||
const fs = __importStar(__webpack_require__(747));
|
const fs = __importStar(__webpack_require__(747));
|
||||||
|
const path = __importStar(__webpack_require__(622));
|
||||||
|
const os = __importStar(__webpack_require__(87));
|
||||||
class CacheDistributor {
|
class CacheDistributor {
|
||||||
constructor(packageManager) {
|
constructor(packageManager) {
|
||||||
this.packageManager = packageManager;
|
this.packageManager = packageManager;
|
||||||
@ -35060,7 +35062,12 @@ class CacheDistributor {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
isCacheDirectoryExists(cacheDirectory) {
|
isCacheDirectoryExists(cacheDirectory) {
|
||||||
const result = cacheDirectory.reduce((previousValue, currentValue) => previousValue || fs.existsSync(currentValue), false);
|
const result = cacheDirectory.reduce((previousValue, currentValue) => {
|
||||||
|
const resolvePath = currentValue.includes('~')
|
||||||
|
? path.join(currentValue.slice(1), os.homedir())
|
||||||
|
: currentValue;
|
||||||
|
return previousValue || fs.existsSync(currentValue);
|
||||||
|
}, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
saveCache() {
|
saveCache() {
|
||||||
|
9
dist/setup/index.js
vendored
9
dist/setup/index.js
vendored
@ -36805,6 +36805,8 @@ const cache = __importStar(__webpack_require__(692));
|
|||||||
const glob = __importStar(__webpack_require__(281));
|
const glob = __importStar(__webpack_require__(281));
|
||||||
const core = __importStar(__webpack_require__(470));
|
const core = __importStar(__webpack_require__(470));
|
||||||
const fs = __importStar(__webpack_require__(747));
|
const fs = __importStar(__webpack_require__(747));
|
||||||
|
const path = __importStar(__webpack_require__(622));
|
||||||
|
const os = __importStar(__webpack_require__(87));
|
||||||
class CacheDistributor {
|
class CacheDistributor {
|
||||||
constructor(packageManager) {
|
constructor(packageManager) {
|
||||||
this.packageManager = packageManager;
|
this.packageManager = packageManager;
|
||||||
@ -36829,7 +36831,12 @@ class CacheDistributor {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
isCacheDirectoryExists(cacheDirectory) {
|
isCacheDirectoryExists(cacheDirectory) {
|
||||||
const result = cacheDirectory.reduce((previousValue, currentValue) => previousValue || fs.existsSync(currentValue), false);
|
const result = cacheDirectory.reduce((previousValue, currentValue) => {
|
||||||
|
const resolvePath = currentValue.includes('~')
|
||||||
|
? path.join(currentValue.slice(1), os.homedir())
|
||||||
|
: currentValue;
|
||||||
|
return previousValue || fs.existsSync(currentValue);
|
||||||
|
}, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
saveCache() {
|
saveCache() {
|
||||||
|
@ -3,6 +3,8 @@ import * as cache from '@actions/cache';
|
|||||||
import * as glob from '@actions/glob';
|
import * as glob from '@actions/glob';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as os from 'os';
|
||||||
|
|
||||||
interface PackageManager {
|
interface PackageManager {
|
||||||
command?: string;
|
command?: string;
|
||||||
@ -36,11 +38,12 @@ abstract class CacheDistributor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected isCacheDirectoryExists(cacheDirectory: string[]) {
|
protected isCacheDirectoryExists(cacheDirectory: string[]) {
|
||||||
const result = cacheDirectory.reduce(
|
const result = cacheDirectory.reduce((previousValue, currentValue) => {
|
||||||
(previousValue, currentValue) =>
|
const resolvePath = currentValue.includes('~')
|
||||||
previousValue || fs.existsSync(currentValue),
|
? path.join(currentValue.slice(1), os.homedir())
|
||||||
false
|
: currentValue;
|
||||||
);
|
return previousValue || fs.existsSync(currentValue);
|
||||||
|
}, false);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user