mirror of https://github.com/aminya/setup-cpp
fix: do not install kcov globally
This commit is contained in:
parent
57de2d5de2
commit
4d96d91b82
|
@ -4,7 +4,6 @@ import untildify from "untildify"
|
||||||
import which from "which"
|
import which from "which"
|
||||||
import { setupCmake } from "../cmake/cmake"
|
import { setupCmake } from "../cmake/cmake"
|
||||||
import { getVersion } from "../default_versions"
|
import { getVersion } from "../default_versions"
|
||||||
import { execSudo } from "../utils/exec/sudo"
|
|
||||||
import { addBinExtension } from "../utils/extension/extension"
|
import { addBinExtension } from "../utils/extension/extension"
|
||||||
import { extractTarByExe } from "../utils/setup/extract"
|
import { extractTarByExe } from "../utils/setup/extract"
|
||||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||||
|
@ -58,8 +57,9 @@ async function buildKcov(file: string, dest: string) {
|
||||||
}
|
}
|
||||||
await execa("cmake", ["-S", "./", "-B", "./build"], { cwd: out, stdio: "inherit" })
|
await execa("cmake", ["-S", "./", "-B", "./build"], { cwd: out, stdio: "inherit" })
|
||||||
await execa("cmake", ["--build", "./build", "--config", "Release"], { cwd: out, stdio: "inherit" })
|
await execa("cmake", ["--build", "./build", "--config", "Release"], { cwd: out, stdio: "inherit" })
|
||||||
execSudo("cmake", ["--install", "./build"], out)
|
// execSudo("cmake", ["--install", "./build"], out)
|
||||||
return "user/local/bin" // the cmake install prefix
|
// return "user/local/bin" // the cmake install prefix
|
||||||
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setupKcov(versionGiven: string, setupDir: string, arch: string) {
|
export async function setupKcov(versionGiven: string, setupDir: string, arch: string) {
|
||||||
|
|
|
@ -113,11 +113,11 @@ export async function setupBin(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const downloaded = await downloadTool(url)
|
const downloaded = await downloadTool(url)
|
||||||
const extractedBinDir = await extractFunction?.(downloaded, setupDir)
|
await extractFunction?.(downloaded, setupDir)
|
||||||
if (typeof extractedBinDir === "string") {
|
// if (typeof extractedBinDir === "string") {
|
||||||
binDir = extractedBinDir
|
// binDir = extractedBinDir
|
||||||
installDir = extractedBinDir
|
// installDir = extractedBinDir
|
||||||
}
|
// }
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(`Failed to download ${name} ${version} ${arch} from ${url}: ${err}`)
|
throw new Error(`Failed to download ${name} ${version} ${arch} from ${url}: ${err}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue