Compile world programs only on first start
This commit is contained in:
+3
-20
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user