Skip to content

Commit

Permalink
fix(hooks): different PATH's name on windows and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
c00t authored and arxanas committed Mar 6, 2024
1 parent e7c3653 commit 3faa074
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-branchless-lib/src/git/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ impl GitRunInfo {
if let Some(path) = env.get(OsStr::new("PATH")) {
path_components.extend(std::env::split_paths(path));
}
// On windows, PATH's name defaults to "Path".
#[cfg(target_os = "windows")]
if let Some(path) = env.get(OsStr::new("Path")) {
path_components.extend(std::env::split_paths(path));
}
std::env::join_paths(path_components).wrap_err("Joining path components")?
};

Expand Down

0 comments on commit 3faa074

Please sign in to comment.