pax-example 0.10.7

Example and development app for the Pax monorepo and compiler
Documentation
use std::process::Command;
use std::env;

fn main() {
    let args: Vec<String> = env::args().skip(1).collect();

    let pax_args = if args.is_empty() {
        vec!["run", "--target=web"]
    } else {
        let mut extended_args = vec!["run"];
        extended_args.extend(args.iter().map(|arg| arg.as_str()));
        extended_args
    };

    let current_dir = env::current_dir().expect("Failed to get current directory");

    let status = Command::new("./pax")
        .args(&pax_args)
        .current_dir(current_dir)
        .status()
        .expect("Failed to execute pax-cli");

    std::process::exit(status.code().unwrap_or(1));
}