mirror of https://github.com/sharkdp/fd.git
Restun exit code for generate_and_execute?
This commit is contained in:
parent
2f18903b29
commit
fa7d49282b
|
@ -146,7 +146,7 @@ impl CommandTemplate {
|
||||||
///
|
///
|
||||||
/// Using the internal `args` field, and a supplied `input` variable, a `Command` will be
|
/// Using the internal `args` field, and a supplied `input` variable, a `Command` will be
|
||||||
/// build. Once all arguments have been processed, the command is executed.
|
/// build. Once all arguments have been processed, the command is executed.
|
||||||
pub fn generate_and_execute(&self, input: &Path, out_perm: Arc<Mutex<()>>) {
|
pub fn generate_and_execute(&self, input: &Path, out_perm: Arc<Mutex<()>>) -> ExitCode {
|
||||||
let input = Self::prepare_path(input);
|
let input = Self::prepare_path(input);
|
||||||
|
|
||||||
let mut cmd = Command::new(self.args[0].generate(&input).as_ref());
|
let mut cmd = Command::new(self.args[0].generate(&input).as_ref());
|
||||||
|
@ -154,7 +154,7 @@ impl CommandTemplate {
|
||||||
cmd.arg(arg.generate(&input).as_ref());
|
cmd.arg(arg.generate(&input).as_ref());
|
||||||
}
|
}
|
||||||
|
|
||||||
execute_command(cmd, &out_perm);
|
execute_command(cmd, &out_perm)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn in_batch_mode(&self) -> bool {
|
pub fn in_batch_mode(&self) -> bool {
|
||||||
|
|
Loading…
Reference in New Issue