From 3faa0744cf0b0c7c2fe2bf20e5f441776f21c6dd Mon Sep 17 00:00:00 2001 From: cupofc0t Date: Tue, 5 Mar 2024 10:55:42 +0800 Subject: [PATCH] fix(hooks): different PATH's name on windows and linux --- git-branchless-lib/src/git/run.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-branchless-lib/src/git/run.rs b/git-branchless-lib/src/git/run.rs index 42623d6a0..f5fa652e3 100644 --- a/git-branchless-lib/src/git/run.rs +++ b/git-branchless-lib/src/git/run.rs @@ -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")? };