This commit is contained in:
YuKun Liu committed 2022-08-27 10:43:17 -07:00
commit 1aaedab752
8 files changed
+21 -22

No files matched your search

+8 -1
View File
@@ -1,5 +1,6 @@
use clap::Parser;
use dioxus_cli::{*, plugin::{PluginManager, PluginConfig}};
use std::process::exit;
#[tokio::main]
async fn main() -> Result<()> {
@@ -15,42 +16,48 @@ async fn main() -> Result<()> {
Commands::Translate(opts) => {
if let Err(e) = opts.translate() {
log::error!("🚫 Translate failed: {}", e);
exit(1);
}
}
Commands::Build(opts) => {
if let Err(e) = opts.build(plugin_manager) {
log::error!("🚫 Build project failed: {}", e);
exit(1);
}
}
Commands::Clean(opts) => {
if let Err(e) = opts.clean() {
log::error!("🚫 Clean project failed: {}", e);
exit(1);
}
}
Commands::Serve(opts) => {
if let Err(e) = opts.serve(plugin_manager).await {
log::error!("🚫 Serve startup failed: {}", e);
exit(1);
}
}
Commands::Create(opts) => {
if let Err(e) = opts.create() {
log::error!("🚫 Create project failed: {}", e);
exit(1);
}
}
Commands::Config(opts) => {
if let Err(e) = opts.config() {
log::error!("config error: {}", e);
exit(1);
}
}
Commands::Plugin(opts) => {
if let Err(e) = opts.plugin().await {
log::error!("plugin error: {}", e);
log::error!("tool error: {}", e);
}
}
}