mirror of https://github.com/aminya/setup-cpp
fix: add addShellHere to fix sh finding ./file
This commit is contained in:
parent
6b4377de1f
commit
722630db75
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -13,3 +13,11 @@ export function addShellExtension(name: string) {
|
|||
}
|
||||
return `${name}.sh`
|
||||
}
|
||||
|
||||
/** Add ./ for unix shell */
|
||||
export function addShellHere(name: string) {
|
||||
if (process.platform === "win32") {
|
||||
return name
|
||||
}
|
||||
return `./${name}`
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import execa from "execa"
|
|||
import path from "path"
|
||||
import untildify from "untildify"
|
||||
import which from "which"
|
||||
import { addShellExtension } from "../utils/extension/extension"
|
||||
import { addShellExtension, addShellHere } from "../utils/extension/extension"
|
||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||
|
||||
let hasVCPKG = false
|
||||
|
@ -13,7 +13,7 @@ export function setupVcpkg(_version: string, _setupCppDir: string, _arch: string
|
|||
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
|
||||
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: untildify("~/") })
|
||||
const vcpkgDir = untildify("~/vcpkg")
|
||||
execa.sync(addShellExtension("bootstrap-vcpkg"), { cwd: vcpkgDir, shell: true })
|
||||
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: vcpkgDir, shell: true })
|
||||
addPath(vcpkgDir)
|
||||
hasVCPKG = true
|
||||
return { binDir: vcpkgDir }
|
||||
|
|
Loading…
Reference in New Issue