mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Add pre-check function
This commit is contained in:
parent
9d45995e86
commit
135d59ce8b
3 changed files with 24 additions and 18 deletions
|
|
@ -16,6 +16,7 @@ pub use cli::{archive::Archive, download::Download, login::Login};
|
|||
|
||||
#[async_trait::async_trait(?Send)]
|
||||
trait Execute {
|
||||
fn pre_check(&self) -> Result<()> { Ok(()) }
|
||||
async fn execute(self, ctx: Context) -> Result<()>;
|
||||
}
|
||||
|
||||
|
|
@ -163,7 +164,7 @@ pub async fn cli_entrypoint() {
|
|||
}
|
||||
};
|
||||
if let Err(err) = result {
|
||||
error!("{}", err);
|
||||
error!("a unexpected error occurred: {}", err);
|
||||
std::process::exit(1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue