(toolPath: string, extension?: string)
| 30 | } |
| 31 | |
| 32 | export async function extractJdkFile(toolPath: string, extension?: string) { |
| 33 | if (!extension) { |
| 34 | extension = toolPath.endsWith('.tar.gz') |
| 35 | ? 'tar.gz' |
| 36 | : path.extname(toolPath); |
| 37 | if (extension.startsWith('.')) { |
| 38 | extension = extension.substring(1); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | switch (extension) { |
| 43 | case 'tar.gz': |
| 44 | case 'tar': |
| 45 | return await tc.extractTar(toolPath); |
| 46 | case 'zip': |
| 47 | return await tc.extractZip(toolPath); |
| 48 | default: |
| 49 | return await tc.extract7z(toolPath); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | export function getDownloadArchiveExtension() { |
| 54 | return process.platform === 'win32' ? 'zip' : 'tar.gz'; |
no outgoing calls
no test coverage detected