feat: commit prettier_build
This commit is contained in:
1 parent
526a88cab1
commit
78c78548e8
2 files changed
+25
-17
No files matched your search
+1
-1
@@ -368,7 +368,7 @@ fn prettier_build(mut cmd: Command) -> anyhow::Result<Vec<Diagnostic>> {
|
|||||||
Message::BuildFinished(finished) => {
|
Message::BuildFinished(finished) => {
|
||||||
if finished.success {
|
if finished.success {
|
||||||
pb.finish_and_clear();
|
pb.finish_and_clear();
|
||||||
println!("Done in");
|
log::info!("Build done.");
|
||||||
} else {
|
} else {
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-16
@@ -434,18 +434,6 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions)
|
|||||||
profile = config.custom_profile.as_ref().unwrap().to_string();
|
profile = config.custom_profile.as_ref().unwrap().to_string();
|
||||||
}
|
}
|
||||||
let hot_reload = if config.hot_reload { "RSX" } else { "Normal" };
|
let hot_reload = if config.hot_reload { "RSX" } else { "Normal" };
|
||||||
let tools_str = format!(
|
|
||||||
"{:?}",
|
|
||||||
config
|
|
||||||
.dioxus_config
|
|
||||||
.application
|
|
||||||
.tools
|
|
||||||
.clone()
|
|
||||||
.unwrap_or_default()
|
|
||||||
.iter()
|
|
||||||
.map(|d| d.0.clone())
|
|
||||||
.collect::<Vec<String>>()
|
|
||||||
);
|
|
||||||
let crate_root = crate::cargo::crate_root().unwrap();
|
let crate_root = crate::cargo::crate_root().unwrap();
|
||||||
let custom_html_file = if crate_root.join("index.html").is_file() {
|
let custom_html_file = if crate_root.join("index.html").is_file() {
|
||||||
"Custom [index.html]"
|
"Custom [index.html]"
|
||||||
@@ -494,15 +482,35 @@ fn print_console_info(port: u16, config: &CrateConfig, options: PrettierOptions)
|
|||||||
println!("");
|
println!("");
|
||||||
println!("\t> Profile : {}", profile.green());
|
println!("\t> Profile : {}", profile.green());
|
||||||
println!("\t> Hot Reload : {}", hot_reload.cyan());
|
println!("\t> Hot Reload : {}", hot_reload.cyan());
|
||||||
println!("\t> Enabled Tools : {}", tools_str.yellow());
|
|
||||||
println!("\t> Index Template : {}", custom_html_file.green());
|
println!("\t> Index Template : {}", custom_html_file.green());
|
||||||
println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple());
|
println!("\t> URL Rewrite [index_on_404] : {}", url_rewrite.purple());
|
||||||
println!("");
|
println!("");
|
||||||
|
println!(
|
||||||
|
"\t> Build Time Use : {} millis",
|
||||||
|
options.elapsed_time.to_string().green().bold()
|
||||||
|
);
|
||||||
|
println!("");
|
||||||
|
|
||||||
if options.changed.len() <= 0 {
|
if options.warnings.len() == 0 {
|
||||||
log::info!("{}", "Server startup completed.".green().bold());
|
log::info!("{}\n", "A perfect compilation!".green().bold());
|
||||||
} else {
|
} else {
|
||||||
log::info!("{}", "Project rebuild completed.".green().bold());
|
log::warn!(
|
||||||
|
"{}\n",
|
||||||
|
format!(
|
||||||
|
"There were {} warning messages during the build: ",
|
||||||
|
options.warnings.len() - 1
|
||||||
|
)
|
||||||
|
.yellow()
|
||||||
|
.bold()
|
||||||
|
);
|
||||||
|
for info in &options.warnings {
|
||||||
|
if info.message == format!("{} warnings emitted", options.warnings.len() - 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if let Some(val) = info.rendered.clone() {
|
||||||
|
log::warn!("{}", val);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user