aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2022-12-28 21:54:49 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2022-12-28 21:54:49 +0100
commit7cecf0b69aa47cf1fc8942b671094f80207edaed (patch)
tree55f64d6cd6951f2f81708f5736caa5070ce0ebba
parent55edccaa6487e43200e0807bbe329f3aea40939f (diff)
Revert "void process output until terminal is ready"
This reverts commit 1d6300d44aa05ab35fe0a85caf5f68c6956d17c5.
-rw-r--r--src/main.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs
index 5e978d4..977db28 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,15 +1,10 @@
use anyhow::bail;
-use std::fs::{self, File};
-use std::io::{self, Write};
-use std::os::fd::AsFd;
+use std::fs;
+use std::io::Write;
use std::process::Command;
use std::thread;
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
-fn null() -> anyhow::Result<File> {
- Ok(File::open("/dev/null")?)
-}
-
fn start() -> anyhow::Result<()> {
let mut stdout = StandardStream::stdout(ColorChoice::Always);
@@ -27,20 +22,13 @@ fn start() -> anyhow::Result<()> {
continue;
}
- let mut cmd = Command::new(service.path());
- cmd.stderr(null()?).stdin(null()?).stdout(null()?);
-
- match cmd.spawn() {
+ match Command::new(service.path()).spawn() {
Ok(_) => {
stdout.set_color(ColorSpec::new().set_fg(Some(Color::Green)))?;
writeln!(&mut stdout, "[ OK ] Starting {}", service_name)?;
stdout.reset()?;
stdout.flush()?;
-
- cmd.stderr(io::stderr().as_fd().try_clone_to_owned()?);
- cmd.stdin(io::stdin().as_fd().try_clone_to_owned()?);
- cmd.stdout(io::stdout().as_fd().try_clone_to_owned()?);
}
Err(e) => {
stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red)))?;