blue-lang-cli 0.0.111

The blue command line: run, fmt, ast, erase, check.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::process::{Command, Output};

pub fn run_fresh_script(command: impl Fn() -> Command) -> Output {
    (0..50)
        .find_map(|_| match command().output() {
            Err(e) if e.kind() == std::io::ErrorKind::ExecutableFileBusy => {
                std::thread::sleep(std::time::Duration::from_millis(20));
                None
            }
            r => Some(r),
        })
        .expect("the script stayed busy for a second")
        .expect("the OS runs the script")
}