Skip to content

Commit 91b042b

Browse files
authored
Strip UNC paths when running hook commands on Windows. (#891)
1 parent bc1cfd2 commit 91b042b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/hooks.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ pub fn spawn_hooks(cfg: Arc<RtcBuild>, stage: PipelineStage) -> HookHandles {
1515
.filter(|hook_cfg| hook_cfg.stage == stage)
1616
.map(|hook_cfg| {
1717
let mut command = Command::new(hook_cfg.command());
18+
let current_dir = if cfg!(target_os = "windows") {
19+
dunce::simplified(&cfg.core.working_directory)
20+
} else {
21+
cfg.core.working_directory.as_path()
22+
};
23+
1824
command
19-
.current_dir(&cfg.core.working_directory)
25+
.current_dir(current_dir)
2026
.args(hook_cfg.command_arguments())
2127
.stdout(Stdio::inherit())
2228
.stderr(Stdio::inherit())

0 commit comments

Comments
 (0)