fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as tc from '@actions/tool-cache'
|
||||
import * as core from '@actions/core'
|
||||
import * as httpm from '@actions/http-client'
|
||||
import * as exec from '@actions/exec'
|
||||
import { GitHubRelease } from './github-release'
|
||||
|
||||
/**
|
||||
@@ -39,12 +40,32 @@ export async function download(version: string): Promise<string> {
|
||||
|
||||
core.info(`Extracting Clang archive...`)
|
||||
|
||||
const extractedPath = await tc.extractTar(
|
||||
archivePath,
|
||||
undefined,
|
||||
'-x --strip-components=1'
|
||||
let exit = await exec.exec('mkdir', ['-p', `/tmp/clang-${version}`])
|
||||
|
||||
if (exit !== 0) {
|
||||
throw new Error(`Failed to create directory /tmp/clang-${version}`)
|
||||
}
|
||||
|
||||
exit = await exec.exec('tar', [
|
||||
'-x',
|
||||
'--strip-components=1',
|
||||
'--warning=no-unknown-keyword',
|
||||
'--overwrite',
|
||||
'-C',
|
||||
`/tmp/clang-${version}`,
|
||||
'-f',
|
||||
archivePath
|
||||
])
|
||||
|
||||
if (exit !== 0) {
|
||||
throw new Error(`Failed to extract clang`)
|
||||
}
|
||||
|
||||
const cachedPath = await tc.cacheDir(
|
||||
`/tmp/clang-${version}`,
|
||||
'clang',
|
||||
version
|
||||
)
|
||||
const cachedPath = await tc.cacheDir(extractedPath, 'clang', version)
|
||||
|
||||
return cachedPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user