Skip to content

Commit

Permalink
chore(command): explicitly set the directory of command to current dir
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jan 20, 2024
1 parent 7023d98 commit 722efd6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion git-cliff-core/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ use std::process::{
Command,
Stdio,
};
use std::str;
use std::thread;
use std::{
env,
str,
};

/// Runs the given OS command and returns the output as string.
///
Expand All @@ -25,13 +28,15 @@ pub fn run(
.args(["/C", command])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.current_dir(env::current_dir()?)
.spawn()
} else {
Command::new("sh")
.envs(envs)
.args(["-c", command])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.current_dir(env::current_dir()?)
.spawn()
}?;
if let Some(input) = input {
Expand Down

0 comments on commit 722efd6

Please sign in to comment.