Merge branch 'master' into master

This commit is contained in:
YuKun Liu authored and GitHub committed 2022-02-14 09:03:23 +08:00
commit 210b456838
17 files changed
+157 -127

No files matched your search

+7 -8
View File
@@ -1,21 +1,20 @@
use crate::{cfg::ConfigOptsServe, gen_page, server, CrateConfig};
use std::{
io::Write,
path::PathBuf,
process::{Command, Stdio},
};
use structopt::StructOpt;
use super::*;
/// Run the WASM project on dev-server
#[derive(Clone, Debug, StructOpt)]
#[structopt(name = "serve")]
#[derive(Clone, Debug, Parser)]
#[clap(name = "serve")]
pub struct Serve {
#[structopt(flatten)]
#[clap(flatten)]
pub serve: ConfigOptsServe,
}
impl Serve {
pub async fn serve(self) -> anyhow::Result<()> {
pub async fn serve(self) -> Result<()> {
let mut crate_config = crate::CrateConfig::new()?;
// change the relase state.
@@ -63,7 +62,7 @@ impl Serve {
return Ok(());
}
_ => {
return Err(anyhow::anyhow!("Unsoppurt platform target."));
return custom_error!("Unsoppurt platform target.");
}
}
@@ -76,7 +75,7 @@ impl Serve {
Ok(())
}
pub fn regen_dev_page(crate_config: &CrateConfig) -> anyhow::Result<()> {
pub fn regen_dev_page(crate_config: &CrateConfig) -> Result<()> {
let serve_html = gen_page(&crate_config.dioxus_config, true);
let mut file = std::fs::File::create(