Compile world programs only on first start

This commit is contained in:
2026-11-12 09:35:51 +00:00
parent 0b79bb4227
commit 03ad478596
5 changed files with 66 additions and 171 deletions
+3 -20
View File
@@ -47,27 +47,10 @@ async fn main() -> anyhow::Result<()> {
"Copy tools failed: default tools unavailable. Set SAUSAGE_USERLAND or pass --userland."
)
})?;
use std::io::{IsTerminal, Write};
let terminal = std::io::stderr().is_terminal();
let mut progress_line = false;
let initialized = sausage::world::World::init_with_progress(&world, &bundle, |line| {
if terminal && line.starts_with("Precompile tools ") {
eprint!("\r\x1b[2K{line}");
let _ = std::io::stderr().flush();
progress_line = true;
} else {
if progress_line {
eprintln!();
progress_line = false;
}
eprintln!("{line}");
}
sausage::world::World::init_with_progress(&world, &bundle, |line| {
eprintln!("{line}");
})
.await;
if progress_line {
eprintln!();
}
initialized?;
.await?;
eprintln!("Next steps:");
eprintln!(
" Edit {} to configure providers and API keys.",