* 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>
20 lines
387 B
Rust
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);
|
|
}
|
|
}
|
|
}
|