Skip to content

Commit ae8148b

Browse files
committed
fix: fix the git installation path on Windows
1 parent 43327b9 commit ae8148b

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-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/cli-options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getInput } from "@actions/core"
22
import { info } from "ci-log"
3+
import type { AddPathOptions } from "envosman"
34
import mri from "mri"
45
import { untildifyUser } from "untildify-user"
56
import { type Inputs, inputs } from "./tool.js"
@@ -88,7 +89,7 @@ export function getSuccessMessage(tool: string, installationInfo: InstallationIn
8889
return msg
8990
}
9091

91-
export const rcOptions = {
92+
export const rcOptions: AddPathOptions = {
9293
rcPath: untildifyUser("~/.cpprc"),
9394
guard: "cpp",
9495
}

src/git/git.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { addPath } from "envosman"
12
import { installAptPack } from "setup-apt"
23
import { installBrewPack } from "setup-brew"
4+
import { rcOptions } from "../cli-options.js"
35
import { hasDnf } from "../utils/env/hasDnf.js"
46
import { isArch } from "../utils/env/isArch.js"
57
import { isUbuntu } from "../utils/env/isUbuntu.js"
@@ -8,10 +10,13 @@ import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
810
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
911

1012
// eslint-disable-next-line @typescript-eslint/no-unused-vars
11-
export function setupGit(version: string, _setupDir: string, _arch: string) {
13+
export async function setupGit(version: string, _setupDir: string, _arch: string) {
1214
switch (process.platform) {
1315
case "win32": {
14-
return setupChocoPack("git", version)
16+
const result = await setupChocoPack("git", version)
17+
result.binDir = "C:/Program Files (x86)/Git/bin"
18+
await addPath(result.binDir, rcOptions)
19+
return result
1520
}
1621
case "darwin": {
1722
return installBrewPack("git", version)

0 commit comments

Comments
 (0)