aboutsummaryrefslogtreecommitdiff
path: root/planetwars-cli/src/lib.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/lib.rs
parent5ca8dd4c842ee681ce81a6a7bbd5005cd5b98d3c (diff)
downloadplanetwars.dev-dacc05a41b77bf2e86e27ac354db9b047c661a7d.tar.xz
planetwars.dev-dacc05a41b77bf2e86e27ac354db9b047c661a7d.zip
refactor workspace code
Diffstat (limited to 'planetwars-cli/src/lib.rs')
-rw-r--r--planetwars-cli/src/lib.rs27
1 files changed, 1 insertions, 26 deletions
diff --git a/planetwars-cli/src/lib.rs b/planetwars-cli/src/lib.rs
index b71164f..e5566b0 100644
--- a/planetwars-cli/src/lib.rs
+++ b/planetwars-cli/src/lib.rs
@@ -1,23 +1,7 @@
-use serde::Deserialize;
-
mod commands;
mod match_runner;
mod web;
-
-use serde::Serialize;
-use std::collections::HashMap;
-use std::path::{Path, PathBuf};
-
-#[derive(Serialize, Deserialize, Debug)]
-struct WorkspaceConfig {
- bots: HashMap<String, BotConfig>,
-}
-
-#[derive(Serialize, Deserialize, Debug, Clone)]
-pub struct BotConfig {
- path: String,
- argv: Vec<String>,
-}
+mod workspace;
pub async fn run() {
let res = commands::Cli::run().await;
@@ -26,12 +10,3 @@ pub async fn run() {
std::process::exit(1);
}
}
-
-fn resolve_bot_config(workspace_dir: &Path, config: BotConfig) -> BotConfig {
- let mut path = PathBuf::from(workspace_dir);
- path.push(&config.path);
- BotConfig {
- path: path.to_str().unwrap().to_string(),
- argv: config.argv,
- }
-}