aboutsummaryrefslogtreecommitdiff
path: root/planetwars-cli/src/workspace
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-28 19:28:19 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-28 19:28:19 +0100
commitee5af8d07625bfc7ad11b842b3941bb095aa6a6e (patch)
treeb1f21f06a6a45b4b36cfcfa50ea5bd16a3132670 /planetwars-cli/src/workspace
parent6d176ac99fb096034ff5406700a7921dab48c24f (diff)
downloadplanetwars.dev-ee5af8d07625bfc7ad11b842b3941bb095aa6a6e.tar.xz
planetwars.dev-ee5af8d07625bfc7ad11b842b3941bb095aa6a6e.zip
implement build command
Diffstat (limited to 'planetwars-cli/src/workspace')
-rw-r--r--planetwars-cli/src/workspace/bot.rs9
1 files changed, 9 insertions, 0 deletions
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<String> {
// 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<Vec<String>> {
+ // 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.")
+ })
+ }
}