particle-os-cli/src/commands.rs
N16hth4wk dbbd087b5b
feat: run clippy + BlueBuildTrait (#4)
* feat: run clippy + BlueBuildTrait

* chore: add default run impl; more clippy

* chore: remove vscode folder; not needed

* cleanups

* Move to commands.rs

* Move functions; remove run function implementation from each command

* Remove run impl from init commands

* Use error log

---------

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2024-01-21 22:26:35 -05:00

20 lines
387 B
Rust

#[cfg(feature = "init")]
pub mod init;
pub mod build;
pub mod local;
pub mod template;
use log::error;
pub trait BlueBuildCommand {
fn try_run(&mut self) -> anyhow::Result<()>;
/// Runs the command and exits if there is an error.
fn run(&mut self) {
if let Err(e) = self.try_run() {
error!("{e}");
std::process::exit(1);
}
}
}