From 7edd1ca47539145cdb627a777f4c62c63bfcbda6 Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Tue, 19 Feb 2019 00:44:55 -0600 Subject: [PATCH] WIP of project commands. Not sure if this should be in scouter library or in main shenlong binary yet though. --- scouter/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scouter/src/lib.rs b/scouter/src/lib.rs index 77f4f76..fb58bc8 100644 --- a/scouter/src/lib.rs +++ b/scouter/src/lib.rs @@ -21,6 +21,22 @@ impl ProjectType { None } + + pub fn build_command(&self) -> Vec { + match self { + ProjectType::Maven => vec!["mvn".to_owned(), "install".to_owned()], + ProjectType::Npm => vec!["npm".to_owned(), "build".to_owned()], + ProjectType::Cargo => vec!["cargo".to_owned(), "build".to_owned()] + } + } + + pub fn run_command(&self) -> Vec { + match self { + ProjectType::Maven => vec!["mvn".to_owned(), "exec".to_owned()], + ProjectType::Npm => vec!["npm".to_owned(), "start".to_owned()], + ProjectType::Cargo => vec!["cargo".to_owned(), "run".to_owned()] + } + } } #[derive(Debug)]