Skip to content

Commit

Permalink
Strip UNC paths when running hook commands on Windows. (#891)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicarlsen authored Oct 28, 2024
1 parent bc1cfd2 commit 91b042b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ pub fn spawn_hooks(cfg: Arc<RtcBuild>, stage: PipelineStage) -> HookHandles {
.filter(|hook_cfg| hook_cfg.stage == stage)
.map(|hook_cfg| {
let mut command = Command::new(hook_cfg.command());
let current_dir = if cfg!(target_os = "windows") {
dunce::simplified(&cfg.core.working_directory)
} else {
cfg.core.working_directory.as_path()
};

command
.current_dir(&cfg.core.working_directory)
.current_dir(current_dir)
.args(hook_cfg.command_arguments())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
Expand Down

0 comments on commit 91b042b

Please sign in to comment.