feat: Configs are captured in a string first

This commit is contained in:
2026-10-04 05:39:19 +02:00
parent 63c014fd3f
commit 231e61d4ad
4 changed files with 54 additions and 32 deletions
+13
View File
@@ -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()
}