mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Just spawn event handlers, don't wait for exit code.
This commit is contained in:
parent
93af49aadf
commit
23d3c1593f
1 changed files with 3 additions and 4 deletions
|
@ -4,13 +4,12 @@ use librespot::playback::player::PlayerEvent;
|
|||
|
||||
fn run_program(program: &str, env_vars: HashMap<&str, String>) {
|
||||
let mut v: Vec<&str> = program.split_whitespace().collect();
|
||||
info!("Running {:?}", v);
|
||||
let status = Command::new(&v.remove(0))
|
||||
info!("Running {:?} with environment variables {:?}", v, env_vars);
|
||||
Command::new(&v.remove(0))
|
||||
.args(&v)
|
||||
.envs(env_vars.iter())
|
||||
.status()
|
||||
.spawn()
|
||||
.expect("program failed to start");
|
||||
info!("Exit status: {}", status);
|
||||
}
|
||||
|
||||
pub fn run_program_on_events(event: PlayerEvent, onevent: &str) {
|
||||
|
|
Loading…
Reference in a new issue