pub fn core_command_uncaptured(
        &mut self, cmd: &str, chunk: &Chunk, i: usize,
    ) -> i32 {
        let prepared_cmd_opt = self.prepare_and_split_command(cmd, chunk, i);
        if prepared_cmd_opt.is_none() {
            return 0;
        }
        let (executable, args) = prepared_cmd_opt.unwrap();

        let process_res = Command::new(executable).args(args).spawn();
        match process_res {
            Ok(mut process) => {
                let res = process.wait();
                match res {
                    Ok(_) => {}
                    Err(e) => {
                        let err_str = format!(
                            "command execution failed: {}",
                            e.to_string()
                        );
                        print_error(chunk, i, &err_str);
                        return 0;
                    }
                }
            }
            Err(e) => {
                let err_str =
                    format!("unable to execute command: {}", e.to_string());
                print_error(chunk, i, &err_str);
                return 0;
            }
        }
        return 1;
    }
/// As per `core_command`, except that the output isn't captured
/// and nothing is placed onto the stack.
As per `core_command`, except that the output isn't captured
and nothing is placed onto the stack.
As per ` core_command ` except that the output isn ' t captured and nothing is placed onto the stack .
pub fn core_command_uncaptured(
        &mut self, cmd: &str, chunk: &Chunk, i: usize,
    ) -> i32 {
        let prepared_cmd_opt = self.prepare_and_split_command(cmd, chunk, i);
        if prepared_cmd_opt.is_none() {
            return 0;
        }
        let (executable, args) = prepared_cmd_opt.unwrap();
        let process_res = Command::new(executable).args(args).spawn();
        match process_res {
            Ok(mut process) => {
                let res = process.wait();
                match res {
                    Ok(_) => {}
                    Err(e) => {
                        let err_str = format!(
                            "command execution failed: {}",
                            e.to_string()
                        );
                        print_error(chunk, i, &err_str);
                        return 0;
                    }
                }
            }
            Err(e) => {
                let err_str =
                    format!("unable to execute command: {}", e.to_string());
                print_error(chunk, i, &err_str);
                return 0;
            }
        }
        return 1;
    }
pub fn core_command_uncaptured ( & mut self , cmd : & str , chunk : & Chunk , i : usize , ) -> i32 { let prepared_cmd_opt = self . prepare_and_split_command ( cmd , chunk , i ) ; if prepared_cmd_opt . is_none ( ) { return 0 ; } let ( executable , args ) = prepared_cmd_opt . unwrap ( ) ; let process_res = Command :: new ( executable ) . args ( args ) . spawn ( ) ; match process_res { Ok ( mut process ) => { let res = process . wait ( ) ; match res { Ok ( _ ) => { } Err ( e ) => { let err_str = format ! ( " " e to_string ( ) ) ; print_error ( chunk , i , & err_str ) ; return 0 ; } } } Err ( e ) => { let err_str = format ! ( " " e to_string ( ) ) ; print_error ( chunk , i , & err_str ) ; return 0 ; } } return 1 ; }
As per `core_command`, except that the output isn't captured
and nothing is placed onto the stack.
As per ` core_command ` except that the output isn ' t captured and nothing is placed onto the stack .
&mut self
cmd
&str
chunk
&Chunk
i
usize