diff --git a/src/commands/build.rs b/src/commands/build.rs index 8e905d7..00030d9 100644 --- a/src/commands/build.rs +++ b/src/commands/build.rs @@ -21,6 +21,7 @@ use crate::core::config::get_resource_type; use crate::core::utils::catch_error_and_exit; use crate::utils::connection::create_client; use crate::utils::display::{print_unicode_box, BorderColor}; +use crate::utils::server::check_and_start_server; /// Defines the `build` command for the CLI application. pub fn command() -> Command { @@ -56,6 +57,7 @@ pub fn execute(matches: &ArgMatches) { let on_failure_val = matches.get_one::("on-failure").unwrap(); let output_file = matches.get_one::("output-file"); + check_and_start_server(); let client = create_client(); let mut runner = CommandRunner::new( client, diff --git a/src/commands/teardown.rs b/src/commands/teardown.rs index b8c5b74..75f28b8 100644 --- a/src/commands/teardown.rs +++ b/src/commands/teardown.rs @@ -19,6 +19,7 @@ use crate::core::config::get_resource_type; use crate::core::utils::catch_error_and_exit; use crate::utils::connection::create_client; use crate::utils::display::{print_unicode_box, BorderColor}; +use crate::utils::server::check_and_start_server; /// Configures the `teardown` command for the CLI application. pub fn command() -> Command { @@ -47,6 +48,7 @@ pub fn execute(matches: &ArgMatches) { let is_show_queries = matches.get_flag("show-queries"); let on_failure_val = matches.get_one::("on-failure").unwrap(); + check_and_start_server(); let client = create_client(); let mut runner = CommandRunner::new( client, diff --git a/src/commands/test.rs b/src/commands/test.rs index af742b3..535e5f3 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -21,6 +21,7 @@ use crate::core::config::get_resource_type; use crate::core::utils::catch_error_and_exit; use crate::utils::connection::create_client; use crate::utils::display::{print_unicode_box, BorderColor}; +use crate::utils::server::check_and_start_server; /// Configures the `test` command for the CLI application. pub fn command() -> Command { @@ -56,6 +57,7 @@ pub fn execute(matches: &ArgMatches) { let on_failure_val = matches.get_one::("on-failure").unwrap(); let output_file = matches.get_one::("output-file"); + check_and_start_server(); let client = create_client(); let mut runner = CommandRunner::new( client,