( packageManagerInfo: PackageManagerInfo )
| 32 | }; |
| 33 | |
| 34 | export const getCacheDirectoryPath = async ( |
| 35 | packageManagerInfo: PackageManagerInfo |
| 36 | ) => { |
| 37 | const pathOutputs = await Promise.allSettled( |
| 38 | packageManagerInfo.cacheFolderCommandList.map(async command => |
| 39 | getCommandOutput(command) |
| 40 | ) |
| 41 | ); |
| 42 | |
| 43 | const results = pathOutputs.map(item => { |
| 44 | if (item.status === 'fulfilled') { |
| 45 | return item.value; |
| 46 | } else { |
| 47 | core.info(`[warning]getting cache directory path failed: ${item.reason}`); |
| 48 | } |
| 49 | |
| 50 | return ''; |
| 51 | }); |
| 52 | |
| 53 | const cachePaths = results.filter(item => item); |
| 54 | |
| 55 | if (!cachePaths.length) { |
| 56 | throw new Error(`Could not get cache folder paths.`); |
| 57 | } |
| 58 | |
| 59 | return cachePaths; |
| 60 | }; |
| 61 | |
| 62 | export function isGhes(): boolean { |
| 63 | const ghUrl = new URL( |
no test coverage detected