embargo_cpp/
lib.rs

1use crate::cli::Args;
2use embargo_toml::EmbargoFile;
3use error::EmbargoResult;
4use log::debug;
5use std::path::Path;
6
7pub mod cli;
8mod embargo_toml;
9mod error;
10mod runtime;
11
12pub fn run(args: Args, temp_dir: Option<&Path>) -> EmbargoResult {
13
14    let read_file = args.read_file();
15
16    let (embargo_toml, embargo_toml_path) = if read_file {
17        let (temp1, temp2) = EmbargoFile::read_file(temp_dir)?;
18        debug!("Embargo.toml read: {:?}\nPath: {:?}", temp1, temp2);
19        (Some(temp1), Some(temp2))
20    } else {
21        (None, None)
22    };
23
24    runtime::run(&args, embargo_toml, embargo_toml_path, read_file, temp_dir)
25}
26