Added tap tempo

This commit is contained in:
Niels Geens
2025-08-05 12:03:26 +02:00
parent 0dd4387917
commit 872f933506
17 changed files with 416 additions and 160 deletions

View File

@@ -27,33 +27,33 @@ pub async fn collect_dir_output(dir: &str, output: &str) {
pub async fn collect_image_output(output: &str) {
use std::fs;
let mut content = String::new();
content.push_str("File Contents:\n");
// Collect specific files mentioned by user
let files_to_collect = vec![
"image/conf/bblayers.conf",
"image/conf/local.conf",
"image/conf/local.conf",
"image/conf/templateconf.cfg",
"image/docker-compose.yml",
"image/Dockerfile",
"image/implementation_plan.md",
"image/run",
];
for file_path in files_to_collect {
if let Ok(file_content) = fs::read_to_string(file_path) {
content.push_str(&format!("\n===== FILE: {} =====\n", file_path));
content.push_str(&file_content);
}
}
// Collect meta-fcb-looper files
if fs::read_dir("image/meta-layers/meta-fcb-looper").is_ok() {
collect_directory_recursive("image/meta-layers/meta-fcb-looper", &mut content);
}
// Write to output file
if let Err(e) = fs::write(output, content) {
eprintln!("Failed to write output file: {}", e);
@@ -64,15 +64,18 @@ pub async fn collect_image_output(output: &str) {
fn collect_directory_recursive(dir_path: &str, content: &mut String) {
use std::fs;
if let Ok(entries) = fs::read_dir(dir_path) {
for entry in entries.flatten() {
let path = entry.path();
if path.is_file() {
let file_path = path.to_string_lossy();
if file_path.ends_with(".bb") || file_path.ends_with(".bbappend") ||
file_path.ends_with(".conf") || file_path.ends_with(".wks") ||
file_path.ends_with(".service") {
if file_path.ends_with(".bb")
|| file_path.ends_with(".bbappend")
|| file_path.ends_with(".conf")
|| file_path.ends_with(".wks")
|| file_path.ends_with(".service")
{
if let Ok(file_content) = fs::read_to_string(&path) {
content.push_str(&format!("\n===== FILE: {} =====\n", file_path));
content.push_str(&file_content);

View File

@@ -26,10 +26,10 @@ pub async fn mapper() {
println!("Starting qjackctl...");
let qjackctl = spawn_qjackctl().await;
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
println!("Starting firmware debugger in new terminal...");
let firmware = spawn_firmware_in_terminal().await;
println!("Starting mapper...");
let mapper = spawn_mapper().await;
@@ -108,7 +108,10 @@ async fn spawn_firmware_in_terminal() -> Child {
#[cfg(target_os = "windows")]
{
Command::new("C:\\Program Files\\Git\\git-bash.exe")
.args(["-c", "cd firmware && cargo run; read -p 'Press Enter to close...'"])
.args([
"-c",
"cd firmware && cargo run; read -p 'Press Enter to close...'",
])
.spawn()
.expect("Could not start firmware debugger in git-bash")
}
@@ -143,11 +146,12 @@ async fn kill_process(child: &mut Child, name: &str) {
Err(e) => {
// Don't print error if process already exited
let error_msg = e.to_string().to_lowercase();
if !error_msg.contains("no such process") &&
!error_msg.contains("not found") &&
!error_msg.contains("invalid argument") {
if !error_msg.contains("no such process")
&& !error_msg.contains("not found")
&& !error_msg.contains("invalid argument")
{
eprintln!("Failed to stop {}: {}", name, e);
}
}
}
}
}