mirror of https://github.com/aminya/setup-cpp
fix: use untildify to get ~/vcpkg
This commit is contained in:
parent
08d77f1fd1
commit
2c34e1795b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,7 @@
|
||||||
import { addPath } from "@actions/core"
|
import { addPath } from "@actions/core"
|
||||||
import execa from "execa"
|
import execa from "execa"
|
||||||
|
import path from "path"
|
||||||
|
import untildify from "untildify"
|
||||||
import which from "which"
|
import which from "which"
|
||||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||||
|
|
||||||
|
@ -8,11 +10,13 @@ let hasVCPKG = false
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export function setupVcpkg(_version: string, _setupCppDir: string, _arch: string): InstallationInfo {
|
export function setupVcpkg(_version: string, _setupCppDir: string, _arch: string): InstallationInfo {
|
||||||
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
|
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
|
||||||
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: "~/" })
|
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: untildify("~/") })
|
||||||
execa.sync("./vcpkg/bootstrap-vcpkg", { cwd: "~/vcpkg" })
|
const vcpkgDir = untildify("~/vcpkg")
|
||||||
addPath("~/vcpkg")
|
execa.sync("./vcpkg/bootstrap-vcpkg", { cwd: vcpkgDir })
|
||||||
|
addPath(vcpkgDir)
|
||||||
hasVCPKG = true
|
hasVCPKG = true
|
||||||
|
return { binDir: vcpkgDir }
|
||||||
}
|
}
|
||||||
|
|
||||||
return { binDir: "~/vcpkg" }
|
return { binDir: path.dirname(which.sync("vcpkg")) }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue