From ee5af8d07625bfc7ad11b842b3941bb095aa6a6e Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 28 Dec 2021 19:28:19 +0100 Subject: implement build command --- planetwars-cli/src/workspace/bot.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'planetwars-cli/src/workspace') diff --git a/planetwars-cli/src/workspace/bot.rs b/planetwars-cli/src/workspace/bot.rs index cc88076..a0ecb90 100644 --- a/planetwars-cli/src/workspace/bot.rs +++ b/planetwars-cli/src/workspace/bot.rs @@ -33,9 +33,18 @@ pub struct BotConfig { } impl BotConfig { + // TODO: these commands should not be here pub fn get_run_argv(&self) -> Vec { // TODO: proper error handling shlex::split(&self.run_command) .expect("Failed to parse bot run command. Check for unterminated quotes.") } + + pub fn get_build_argv(&self) -> Option> { + // TODO: proper error handling + self.build_command.as_ref().map(|cmd| { + shlex::split(cmd) + .expect("Failed to parse bot build command. Check for unterminated quotes.") + }) + } } -- cgit v1.2.3