Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejVukosav committed Dec 18, 2024
1 parent 236b46e commit 429e326
Show file tree
Hide file tree
Showing 8 changed files with 328 additions and 258 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/meroctl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "meroctl"
version = "0.2.0"
version = "0.2.1"
authors.workspace = true
edition.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/meroctl/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl RootCommand {
SubCommands::JsonRpc(jsonrpc) => jsonrpc.run(&environment).await,
SubCommands::Proxy(proxy) => proxy.run(&environment).await,
SubCommands::Call(call) => call.run(&environment).await,
SubCommands::Bootstrap(call) => call.run(&environment).await,
SubCommands::Bootstrap(call) => call.run().await,
};

if let Err(err) = result {
Expand Down
6 changes: 4 additions & 2 deletions crates/meroctl/src/cli/app/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ impl Report for InstallApplicationResponse {

impl InstallCommand {
pub async fn run(self, environment: &Environment) -> Result<()> {
InstallCommand::install_app(self.path, self.hash, self.metadata, self.url, environment)
.await;
drop(
InstallCommand::install_app(self.path, self.hash, self.metadata, self.url, environment)
.await,
);

Ok(())
}
Expand Down
12 changes: 7 additions & 5 deletions crates/meroctl/src/cli/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ use const_format::concatcp;
use eyre::Result as EyreResult;
use start::StartBootstrapCommand;

use crate::cli::Environment;

mod start;

pub const EXAMPLES: &str = r"
#
# Setup and run 2 nodes with demo app
$ meroctl -- --node-name node1 bootstrap start --merod-path /path/to/merod
# Setup and run 2 nodes with provided app
$ meroctl -- --node-name node1 bootstrap start --merod-path /path/to/merod --app-path /path/to/app
";

#[derive(Debug, Parser)]
Expand All @@ -29,9 +31,9 @@ pub enum BootstrapSubCommands {
}

impl BootstrapCommand {
pub async fn run(self, environment: &Environment) -> EyreResult<()> {
pub async fn run(self) -> EyreResult<()> {
match self.subcommand {
BootstrapSubCommands::Start(generate) => generate.run(environment).await,
BootstrapSubCommands::Start(generate) => generate.run().await,
}
}
}
Loading

0 comments on commit 429e326

Please sign in to comment.