feat: clean command

This commit is contained in:
mrxiaozhuox committed 2022-01-23 22:50:23 +08:00
1 parent 9bb10c65a3
commit 7343af2089
10 files changed
+152 -34

No files matched your search

+21 -1
View File
@@ -1,4 +1,6 @@
use crate::cfg::ConfigOptsBuild;
use std::{io::Write, path::PathBuf};
use crate::{cfg::ConfigOptsBuild, gen_page};
use structopt::StructOpt;
/// Build the Rust WASM app and all of its assets.
@@ -18,6 +20,24 @@ impl Build {
crate::builder::build(&crate_config)?;
let temp = gen_page(&crate_config.dioxus_config, false);
let mut file = std::fs::File::create(
crate_config
.crate_dir
.join(
crate_config
.dioxus_config
.web
.app
.out_dir
.clone()
.unwrap_or(PathBuf::from("dist")),
)
.join("index.html"),
)?;
file.write_all(temp.as_bytes())?;
Ok(())
}
}