aboutsummaryrefslogtreecommitdiff
path: root/planetwars-cli/src/commands/serve.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-28 14:57:41 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-28 14:57:41 +0100
commitdacc05a41b77bf2e86e27ac354db9b047c661a7d (patch)
tree3d71fa60ff3449f73ec8bb6066ae82733eb46ee4 /planetwars-cli/src/commands/serve.rs
parent5ca8dd4c842ee681ce81a6a7bbd5005cd5b98d3c (diff)
downloadplanetwars.dev-dacc05a41b77bf2e86e27ac354db9b047c661a7d.tar.xz
planetwars.dev-dacc05a41b77bf2e86e27ac354db9b047c661a7d.zip
refactor workspace code
Diffstat (limited to 'planetwars-cli/src/commands/serve.rs')
-rw-r--r--planetwars-cli/src/commands/serve.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/planetwars-cli/src/commands/serve.rs b/planetwars-cli/src/commands/serve.rs
index a078c83..aa8d149 100644
--- a/planetwars-cli/src/commands/serve.rs
+++ b/planetwars-cli/src/commands/serve.rs
@@ -1,18 +1,17 @@
-use std::env;
use std::io;
use clap::Parser;
use crate::web;
+use crate::workspace::Workspace;
#[derive(Parser)]
pub struct ServeCommand;
impl ServeCommand {
pub async fn run(self) -> io::Result<()> {
- let workspace_root = env::current_dir().unwrap();
-
- web::run(workspace_root).await;
+ let workspace = Workspace::open_current_dir()?;
+ web::run(workspace).await;
Ok(())
}
}