This commit is contained in:
nora 2022-10-06 21:31:02 +02:00
commit a2bc92d651
No known key found for this signature in database
10 changed files with 1548 additions and 0 deletions

30
src/lib.rs Normal file
View file

@ -0,0 +1,30 @@
#![allow(dead_code)]
use std::path::Path;
mod build;
mod expand;
use anyhow::{Context, Result};
pub fn minimize(cargo_dir: &Path) -> Result<()> {
let file = expand::expand(cargo_dir).context("during expansion")?;
let file = prettyplease::unparse(&file);
println!("// EXPANDED-START\n\n{file}\n\n// EXPANDED-END");
std::fs::write("expanded.rs", file)?;
println!("wow, expanded");
Ok(())
/*
let build = Build::new(cargo_dir);
if build.build()?.success {
bail!("build must initially fail!");
}
*/
}