mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-05-18 23:32:48 +00:00
fix: fall through to self-launch when peer forward fails
Some checks failed
Continuous integration / test (push) Has been cancelled
Some checks failed
Continuous integration / test (push) Has been cancelled
This commit is contained in:
parent
bbbe882faf
commit
60ccf06a29
1 changed files with 9 additions and 2 deletions
11
src/main.rs
11
src/main.rs
|
|
@ -88,8 +88,15 @@ fn main() {
|
||||||
commands_path.push_str(&username());
|
commands_path.push_str(&username());
|
||||||
let socket_path = Path::new(&commands_path);
|
let socket_path = Path::new(&commands_path);
|
||||||
if let Ok(mut stream) = PipeClient::connect(socket_path) {
|
if let Ok(mut stream) = PipeClient::connect(socket_path) {
|
||||||
stream.write_all(command.as_bytes()).ok();
|
let forwarded = stream
|
||||||
exit(0);
|
.write_all(command.as_bytes())
|
||||||
|
.and_then(|_| stream.flush())
|
||||||
|
.is_ok();
|
||||||
|
drop(stream);
|
||||||
|
if forwarded {
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
eprintln!("Failed to forward command to existing Stremio instance; launching new instance");
|
||||||
}
|
}
|
||||||
// END IPC
|
// END IPC
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue