typedshell 0.1.0

A typed TypeScript subset compiled to standalone Bash or other shell targets
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::{error::Error, path::PathBuf};

use tsh::{CompileOptions, compile_file};

fn main() -> Result<(), Box<dyn Error>> {
    let path = std::env::args_os()
        .nth(1)
        .map(PathBuf::from)
        .unwrap_or_else(|| PathBuf::from("examples/hello.tsh"));
    let script = compile_file(path, &CompileOptions::default())?;
    print!("{script}");
    Ok(())
}