From 0d03a0fbc214dd3fb9a8af562f9d88cccaf5f2c0 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 26 Dec 2021 21:54:26 +0100 Subject: refactor commands --- planetwars-cli/src/commands/serve.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 planetwars-cli/src/commands/serve.rs (limited to 'planetwars-cli/src/commands/serve.rs') diff --git a/planetwars-cli/src/commands/serve.rs b/planetwars-cli/src/commands/serve.rs new file mode 100644 index 0000000..2a2e59b --- /dev/null +++ b/planetwars-cli/src/commands/serve.rs @@ -0,0 +1,18 @@ +use std::env; +use std::io; + +use clap::Parser; + +use crate::web; + +#[derive(Parser)] +pub struct ServeCommand; + +impl ServeCommand { + pub async fn run(self) -> io::Result<()> { + let project_dir = env::current_dir().unwrap(); + + web::run(project_dir).await; + Ok(()) + } +} -- cgit v1.2.3