type_build/
lib.rs

1use std::fs;
2use std::path::Path;
3pub use type_macro::TS;
4
5
6/**
7 * 构建生成路径
8 * @param type_Path 生成路径(为绝对路径)
9**/
10pub fn build(type_Path: &str) {
11    // 将 type_Path 路径保存到宏可以读取的地方
12    let out_dir = std::env::var("OUT_DIR").unwrap();;
13    let dest_path = Path::new(&out_dir).join("config.txt");
14    fs::write(&dest_path, type_Path).unwrap();
15}