Skip to content

Commit 722630d

Browse files
committed
fix: add addShellHere to fix sh finding ./file
1 parent 6b4377d commit 722630d

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/extension/extension.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ export function addShellExtension(name: string) {
1313
}
1414
return `${name}.sh`
1515
}
16+
17+
/** Add ./ for unix shell */
18+
export function addShellHere(name: string) {
19+
if (process.platform === "win32") {
20+
return name
21+
}
22+
return `./${name}`
23+
}

src/vcpkg/vcpkg.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import execa from "execa"
33
import path from "path"
44
import untildify from "untildify"
55
import which from "which"
6-
import { addShellExtension } from "../utils/extension/extension"
6+
import { addShellExtension, addShellHere } from "../utils/extension/extension"
77
import { InstallationInfo } from "../utils/setup/setupBin"
88

99
let hasVCPKG = false
@@ -13,7 +13,7 @@ export function setupVcpkg(_version: string, _setupCppDir: string, _arch: string
1313
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
1414
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: untildify("~/") })
1515
const vcpkgDir = untildify("~/vcpkg")
16-
execa.sync(addShellExtension("bootstrap-vcpkg"), { cwd: vcpkgDir, shell: true })
16+
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: vcpkgDir, shell: true })
1717
addPath(vcpkgDir)
1818
hasVCPKG = true
1919
return { binDir: vcpkgDir }

0 commit comments

Comments
 (0)