registered the new setup command
This commit is contained in:
@@ -2,11 +2,12 @@ use std::collections::HashMap;
|
|||||||
|
|
||||||
use traits::Command;
|
use traits::Command;
|
||||||
|
|
||||||
use self::build::Build;
|
use self::{build::Build, setup::Setup};
|
||||||
|
|
||||||
pub mod traits;
|
pub mod traits;
|
||||||
pub mod executions;
|
pub mod executions;
|
||||||
mod build;
|
mod build;
|
||||||
|
mod setup;
|
||||||
|
|
||||||
pub struct CommandRegistry {
|
pub struct CommandRegistry {
|
||||||
commands: HashMap<String, Box<dyn Command>>
|
commands: HashMap<String, Box<dyn Command>>
|
||||||
@@ -16,7 +17,9 @@ impl CommandRegistry {
|
|||||||
|
|
||||||
pub fn register_all(&mut self) {
|
pub fn register_all(&mut self) {
|
||||||
let registry = self;
|
let registry = self;
|
||||||
registry.register("/build".to_string(), Box::new(Build::new()), true)
|
registry.register("/build".to_string(), Box::new(Build::new()), true);
|
||||||
|
registry.register("/setup".to_string(), Box::new(Setup::new()), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn register(&mut self, path: String, command: Box<dyn Command>, enabled: bool) {
|
pub fn register(&mut self, path: String, command: Box<dyn Command>, enabled: bool) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ pub struct Setup;
|
|||||||
|
|
||||||
impl Command for Setup {
|
impl Command for Setup {
|
||||||
fn execute(&self, _args: &HashMap<String, String>) -> Result<(), String> {
|
fn execute(&self, _args: &HashMap<String, String>) -> Result<(), String> {
|
||||||
|
println!("setting up");
|
||||||
return Ok(())
|
return Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user