mirror of https://github.com/aminya/setup-cpp
fix: add git and pkg-config as the dependencies of vcpkg
This commit is contained in:
parent
4a419e6a17
commit
0634668674
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12,18 +12,20 @@ let hasVCPKG = false
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export async function setupVcpkg(_version: string, setupDir: string, _arch: string): Promise<InstallationInfo> {
|
||||
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
|
||||
if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) {
|
||||
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) })
|
||||
} else {
|
||||
warning(`Vcpkg folder already exists at ${setupDir}`)
|
||||
}
|
||||
|
||||
if (process.platform === "linux") {
|
||||
// vcpkg download and extraction dependencies
|
||||
await setupAptPack("curl")
|
||||
await setupAptPack("zip")
|
||||
await setupAptPack("unzip")
|
||||
await setupAptPack("tar")
|
||||
await setupAptPack("git")
|
||||
await setupAptPack("pkg-config")
|
||||
}
|
||||
|
||||
if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) {
|
||||
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) })
|
||||
} else {
|
||||
warning(`Vcpkg folder already exists at ${setupDir}`)
|
||||
}
|
||||
|
||||
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: setupDir, shell: true })
|
||||
|
|
Loading…
Reference in New Issue