diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 6b87d22..b1f31fb 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -60458,13 +60458,16 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void exports.getPackageManagerInfo = getPackageManagerInfo; const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () { const pathOutputs = yield Promise.allSettled(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); }))); - pathOutputs - .filter(output => output.status === 'rejected') - .forEach(output => core.warning(`getting cache directory path failed: ${output.reason}`)); - const cachePaths = pathOutputs - .filter(output => output.status === 'fulfilled' && - output.value) - .map(output => output.value); + const results = pathOutputs.map(item => { + if (item.status === 'fulfilled') { + return item.value; + } + else { + core.info(`[warning]getting cache directory path failed: ${item.reason}`); + } + return ''; + }); + const cachePaths = results.filter(item => item); if (!cachePaths.length) { throw new Error(`Could not get cache folder paths.`); } diff --git a/dist/setup/index.js b/dist/setup/index.js index c8cf91b..03a920f 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63131,13 +63131,16 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void exports.getPackageManagerInfo = getPackageManagerInfo; const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () { const pathOutputs = yield Promise.allSettled(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); }))); - pathOutputs - .filter(output => output.status === 'rejected') - .forEach(output => core.warning(`getting cache directory path failed: ${output.reason}`)); - const cachePaths = pathOutputs - .filter(output => output.status === 'fulfilled' && - output.value) - .map(output => output.value); + const results = pathOutputs.map(item => { + if (item.status === 'fulfilled') { + return item.value; + } + else { + core.info(`[warning]getting cache directory path failed: ${item.reason}`); + } + return ''; + }); + const cachePaths = results.filter(item => item); if (!cachePaths.length) { throw new Error(`Could not get cache folder paths.`); } diff --git a/src/cache-utils.ts b/src/cache-utils.ts index 76cc0da..545c97a 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -40,23 +40,17 @@ export const getCacheDirectoryPath = async ( ) ); - pathOutputs - .filter(output => output.status === 'rejected') - .forEach(output => - core.warning( - `getting cache directory path failed: ${ - (output as PromiseRejectedResult).reason - }` - ) - ); + const results = pathOutputs.map(item => { + if (item.status === 'fulfilled') { + return item.value; + } else { + core.info(`[warning]getting cache directory path failed: ${item.reason}`); + } - const cachePaths = pathOutputs - .filter( - output => - output.status === 'fulfilled' && - (output as PromiseFulfilledResult).value - ) - .map(output => (output as PromiseFulfilledResult).value); + return ''; + }); + + const cachePaths = results.filter(item => item); if (!cachePaths.length) { throw new Error(`Could not get cache folder paths.`);