feat: Configs are captured in a string first
This commit is contained in:
+13
@@ -2,6 +2,8 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use tokio::process::Command;
|
||||
|
||||
pub mod cluster;
|
||||
pub mod environment;
|
||||
pub mod node;
|
||||
@@ -29,3 +31,14 @@ pub fn get_talos_path() -> PathBuf {
|
||||
pub fn get_configs_path() -> PathBuf {
|
||||
get_repo_path().join("configs")
|
||||
}
|
||||
|
||||
pub async fn run_command(mut command: Command) -> String {
|
||||
let output = command.output().await.unwrap();
|
||||
if !output.stderr.is_empty() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stderr).trim_end());
|
||||
}
|
||||
|
||||
String::from_utf8_lossy(&output.stdout)
|
||||
.trim_end()
|
||||
.to_owned()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user