chobs 0.1.5

Chobs (Changes Observer) is a tool that automatically restarting your process when file changes in the selected directory. It may be you system process or your project execution. For example if you don't want to call `cargo run` on every code changes, you can use Chobs.
Documentation
//! Command to execute

use std::{
    io,
    process::{Child, Command},
};

pub struct Exec {
    pub command: Command,
    pub exec_string: String,
}

impl Exec {
    pub fn new(exec: String) -> Self {
        let mut exec_vec = exec.split(" ").collect::<Vec<&str>>();
        let mut command = Command::new(exec_vec[0]);
        exec_vec.remove(0);
        command.args(exec_vec);
        Exec {
            command,
            exec_string: exec,
        }
    }

    pub fn run_as_child(&mut self) -> Result<Child, io::Error> {
        self.command.spawn()
    }
}