Skip to content

Commit 7589061

Browse files
committed
fix: fix addition of git to PATH on Windows
1 parent a716227 commit 7589061

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

dist/legacy/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/legacy/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.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.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/git/git.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { isUbuntu } from "../utils/env/isUbuntu.js"
1212
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
1313
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
1414
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
15+
import { join } from "path"
1516

1617
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1718
export async function setupGit(version: string, _setupDir: string, _arch: string) {
@@ -53,11 +54,11 @@ export async function setupGit(version: string, _setupDir: string, _arch: string
5354

5455
function findWindowsGit() {
5556
const candidates = [
56-
"C:/Program Files/Git/bin/git.exe",
57-
"C:/Program Files (x86)/Git/bin/git.exe",
57+
"C:/Program Files/Git/bin/",
58+
"C:/Program Files (x86)/Git/bin/",
5859
]
5960
for (const candidate of candidates) {
60-
if (existsSync(candidate)) {
61+
if (existsSync(join(candidate, "git.exe"))) {
6162
return candidate
6263
}
6364
}

0 commit comments

Comments
 (0)