vicuna-runtime 0.1.1

Runtime for the Vicuna programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use std::path::Path;
use std::process::Command;
use which::which;

pub fn execute_file(file_path: &Path) -> Result<()> {
    println!("=================");
    let exit_status = Command::new(which("node")?)
        .arg(file_path)
        .spawn()?
        .wait()?;
    println!("=================");
    if exit_status.success() {
        Ok(())
    } else {
        Err(anyhow::anyhow!("execution failed"))
    }
}