added the serve command

This commit is contained in:
2023-03-09 17:47:38 +01:00
parent 7bce49a8a9
commit fb147e5857
4 changed files with 9 additions and 17 deletions

View File

@@ -13,5 +13,7 @@ pub enum CommandArg {
/// Checks if everything required for docki is installed
Health,
/// Helper command for installing asciidoctor-reveal-js
InstallReveal
InstallReveal,
/// Starts a Webserver with the live preview of the Documentation
Serve
}

View File

@@ -1,6 +1,5 @@
pub mod traits;
pub mod executions;
pub mod build;
pub mod health;
pub mod install_reveal;
mod serve;
pub mod serve;

View File

@@ -1,14 +1,3 @@
use super::traits::Command;
pub struct Serve;
impl Command for Serve {
fn execute(&self, _args: &std::collections::HashMap<String, String>) -> Result<(), String> {
println!("serving the application");
return Ok(())
}
fn new() -> Self where Self: Sized {
return Self {}
}
pub fn serve() {
println!("serving the developement version")
}

View File

@@ -9,6 +9,7 @@ use self::args::{args, structure::CommandArg};
use self::commands::build::build;
use self::commands::health::health;
use self::commands::install_reveal::install_reveal;
use self::commands::serve::serve;
pub struct App;
@@ -21,7 +22,8 @@ impl App {
match args.command {
CommandArg::Build => build(),
CommandArg::Health => health(),
CommandArg::InstallReveal => install_reveal()
CommandArg::InstallReveal => install_reveal(),
CommandArg::Serve => serve()
}
}