mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
Allow overridable node binary paths
This commit is contained in:
parent
e0e7d32159
commit
0d7f3332fa
@ -1,5 +1,6 @@
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
env,
|
||||
path::PathBuf,
|
||||
process::{Child, Command, Stdio},
|
||||
time::Duration,
|
||||
@ -30,11 +31,24 @@ use crate::{IS_DEBUG_TRACING, adjust_timeout, nodes::LOGS_PREFIX};
|
||||
const BIN_PATH: &str = "target/debug/nomos-executor";
|
||||
|
||||
fn binary_path() -> PathBuf {
|
||||
if let Some(path) = env::var_os("NOMOS_EXECUTOR_BIN") {
|
||||
return PathBuf::from(path);
|
||||
}
|
||||
if let Some(path) = which_on_path("nomos-executor") {
|
||||
return path;
|
||||
}
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../")
|
||||
.join(BIN_PATH)
|
||||
}
|
||||
|
||||
fn which_on_path(bin: &str) -> Option<PathBuf> {
|
||||
let path_env = env::var_os("PATH")?;
|
||||
env::split_paths(&path_env)
|
||||
.map(|p| p.join(bin))
|
||||
.find(|candidate| candidate.is_file())
|
||||
}
|
||||
|
||||
pub struct Executor {
|
||||
tempdir: tempfile::TempDir,
|
||||
child: Child,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
env,
|
||||
path::PathBuf,
|
||||
process::{Child, Command, Stdio},
|
||||
time::Duration,
|
||||
@ -29,11 +30,24 @@ use crate::{IS_DEBUG_TRACING, adjust_timeout, nodes::LOGS_PREFIX};
|
||||
const BIN_PATH: &str = "target/debug/nomos-node";
|
||||
|
||||
fn binary_path() -> PathBuf {
|
||||
if let Some(path) = env::var_os("NOMOS_NODE_BIN") {
|
||||
return PathBuf::from(path);
|
||||
}
|
||||
if let Some(path) = which_on_path("nomos-node") {
|
||||
return path;
|
||||
}
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../")
|
||||
.join(BIN_PATH)
|
||||
}
|
||||
|
||||
fn which_on_path(bin: &str) -> Option<PathBuf> {
|
||||
let path_env = env::var_os("PATH")?;
|
||||
env::split_paths(&path_env)
|
||||
.map(|p| p.join(bin))
|
||||
.find(|candidate| candidate.is_file())
|
||||
}
|
||||
|
||||
pub enum Pool {
|
||||
Da,
|
||||
Mantle,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user