cli: Improve error when `radicle-node` isn't found
This commit is contained in:
parent
25c7162760
commit
33be2a62da
|
|
@ -3,6 +3,7 @@ use std::fs::{File, OpenOptions};
|
||||||
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom};
|
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom};
|
||||||
use std::{fs, io, path::Path, process, thread, time};
|
use std::{fs, io, path::Path, process, thread, time};
|
||||||
|
|
||||||
|
use anyhow::anyhow;
|
||||||
use localtime::LocalTime;
|
use localtime::LocalTime;
|
||||||
|
|
||||||
use radicle::node;
|
use radicle::node;
|
||||||
|
|
@ -61,7 +62,8 @@ pub fn start(
|
||||||
.stdin(process::Stdio::null())
|
.stdin(process::Stdio::null())
|
||||||
.stdout(process::Stdio::from(log.try_clone()?))
|
.stdout(process::Stdio::from(log.try_clone()?))
|
||||||
.stderr(process::Stdio::from(log))
|
.stderr(process::Stdio::from(log))
|
||||||
.spawn()?;
|
.spawn()
|
||||||
|
.map_err(|e| anyhow!("failed to start node process {cmd:?}: {e}"))?;
|
||||||
let pid = term::format::parens(term::format::dim(child.id()));
|
let pid = term::format::parens(term::format::dim(child.id()));
|
||||||
|
|
||||||
if verbose {
|
if verbose {
|
||||||
|
|
@ -98,7 +100,8 @@ pub fn start(
|
||||||
let mut child = process::Command::new(cmd)
|
let mut child = process::Command::new(cmd)
|
||||||
.args(options)
|
.args(options)
|
||||||
.envs(envs)
|
.envs(envs)
|
||||||
.spawn()?;
|
.spawn()
|
||||||
|
.map_err(|e| anyhow!("failed to start node process {cmd:?}: {e}"))?;
|
||||||
|
|
||||||
child.wait()?;
|
child.wait()?;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue