Merge pull request #31 from jonathandturner/buildargs

Build our own args before shelling
This commit is contained in:
Jonathan Turner 2019-05-25 15:25:39 -07:00 committed by GitHub
commit cd92f579c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,8 +122,12 @@ impl ExternalCommand {
input: ClassifiedInputStream, input: ClassifiedInputStream,
stream_next: StreamNext, stream_next: StreamNext,
) -> Result<ClassifiedInputStream, ShellError> { ) -> Result<ClassifiedInputStream, ShellError> {
let process = Exec::shell(&self.name) let mut cmd = self.name.clone();
.args(&self.args) for arg in self.args {
cmd.push_str(" ");
cmd.push_str(&arg);
}
let process = Exec::shell(&cmd)
.cwd(context.env.lock().unwrap().cwd()); .cwd(context.env.lock().unwrap().cwd());
let mut process = match stream_next { let mut process = match stream_next {