This commit is contained in:
Evan Almloff committed 2022-06-16 13:20:41 -05:00
commit 11d045deeb
11 files changed
+361 -18

No files matched your search

+5
View File
@@ -14,11 +14,16 @@ impl Build {
// change the release state.
crate_config.with_release(self.build.release);
crate_config.with_verbose(self.build.verbose);
if self.build.example.is_some() {
crate_config.as_example(self.build.example.unwrap());
}
if self.build.profile.is_some() {
crate_config.set_profile(self.build.profile.unwrap());
}
let platform = self.build.platform.unwrap_or_else(|| {
crate_config
.dioxus_config
+26
View File
@@ -12,13 +12,26 @@ pub struct ConfigOptsBuild {
#[serde(default)]
pub release: bool,
// Use verbose output [default: false]
#[clap(long)]
#[serde(default)]
pub verbose: bool,
/// Build a example [default: ""]
#[clap(long)]
pub example: Option<String>,
/// Build with custom profile
#[clap(long)]
pub profile: Option<String>,
/// Build platform: support Web & Desktop [default: "default_platform"]
#[clap(long)]
pub platform: Option<String>,
/// Space separated list of features to activate
#[clap(long)]
pub features: Option<Vec<String>>,
}
#[derive(Clone, Debug, Default, Deserialize, Parser)]
@@ -36,6 +49,15 @@ pub struct ConfigOptsServe {
#[serde(default)]
pub release: bool,
// Use verbose output [default: false]
#[clap(long)]
#[serde(default)]
pub verbose: bool,
/// Build with custom profile
#[clap(long)]
pub profile: Option<String>,
/// Build platform: support Web & Desktop [default: "default_platform"]
#[clap(long)]
pub platform: Option<String>,
@@ -44,6 +66,10 @@ pub struct ConfigOptsServe {
#[clap(long)]
#[serde(default)]
pub hot_reload: bool,
/// Space separated list of features to activate
#[clap(long)]
pub features: Option<Vec<String>>,
}
/// Ensure the given value for `--public-url` is formatted correctly.
+7 -3
View File
@@ -18,14 +18,18 @@ impl Serve {
let mut crate_config = crate::CrateConfig::new()?;
// change the relase state.
crate_config
.with_release(self.serve.release)
.with_hot_reload(self.serve.hot_reload);
crate_config.with_hot_reload(self.serve.hot_reload);
crate_config.with_release(self.serve.release);
crate_config.with_verbose(self.serve.verbose);
if self.serve.example.is_some() {
crate_config.as_example(self.serve.example.unwrap());
}
if self.serve.profile.is_some() {
crate_config.set_profile(self.serve.profile.unwrap());
}
let platform = self.serve.platform.unwrap_or_else(|| {
crate_config
.dioxus_config
+7 -4
View File
@@ -20,14 +20,18 @@ impl Tool {
Tool::List {} => {
for item in tools::tool_list() {
if tools::Tool::from_str(item).unwrap().is_installed() {
println!("{item} [installed]");
println!("- {item} [installed]");
} else {
println!("{item}");
println!("- {item}");
}
}
}
Tool::AppPath {} => {
println!("{}", tools::tools_path().to_str().unwrap());
if let Some(v) = tools::tools_path().to_str() {
println!("{}", v);
} else {
log::error!("Tools path get failed.");
}
}
Tool::Add { name } => {
let tool_list = tools::tool_list();
@@ -58,7 +62,6 @@ impl Tool {
log::info!("Tool {name} install successfully!");
}
}
Ok(())
}
}