diff --git a/src/main.rs b/src/main.rs index 9a60750..9ebca56 100755 --- a/src/main.rs +++ b/src/main.rs @@ -12,9 +12,9 @@ use crate::workspace::read_cfg; static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; mod internal; +mod operations; mod repository; mod workspace; -mod operations; fn main() { extern "C" { @@ -137,11 +137,11 @@ fn main() { } if let true = matches.is_present("reinit") { - operations::reinit(); + operations::reinit(); } if let true = matches.is_present("build") { - operations::build(&matches); + operations::build(&matches); } if let true = matches.is_present("pull") { @@ -211,4 +211,4 @@ fn main() { if let true = matches.is_present("config") { operations::config(); } -} \ No newline at end of file +} diff --git a/src/operations/build.rs b/src/operations/build.rs index 50e9552..d68878a 100644 --- a/src/operations/build.rs +++ b/src/operations/build.rs @@ -1,5 +1,6 @@ -use clap::ArgMatches; +use crate::repository::generate; use crate::{crash, repository, workspace}; +use clap::ArgMatches; pub fn build(matches: &ArgMatches) { let config = workspace::read_cfg(); @@ -15,7 +16,6 @@ pub fn build(matches: &ArgMatches) { .values_of_lossy("exclude") .unwrap_or_default(); - for pkg in &exclude { packages.retain(|x| &*x != pkg); } @@ -57,6 +57,7 @@ pub fn build(matches: &ArgMatches) { for pkg in repos { repository::build(pkg); } + generate(); } if matches @@ -66,4 +67,4 @@ pub fn build(matches: &ArgMatches) { { repository::generate(); } -} \ No newline at end of file +} diff --git a/src/operations/config.rs b/src/operations/config.rs index b5ad1d2..4e102cf 100644 --- a/src/operations/config.rs +++ b/src/operations/config.rs @@ -1,3 +1,8 @@ +use crate::create_config; +use std::env; +use std::path::Path; +use std::process::Command; + pub fn config() { if !Path::exists("mlc.toml".as_ref()) { create_config(); @@ -9,4 +14,4 @@ pub fn config() { .unwrap() .wait() .unwrap(); -} \ No newline at end of file +} diff --git a/src/operations/init.rs b/src/operations/init.rs index 29d7933..ddce2f7 100644 --- a/src/operations/init.rs +++ b/src/operations/init.rs @@ -1,5 +1,5 @@ -use std::process::Command; use crate::{crash, info, workspace}; +use std::process::Command; pub fn reinit() { let config = workspace::read_cfg(); @@ -79,4 +79,4 @@ pub fn init() { } else { crash("Invalid mode in mlc.toml".to_string(), 1); } -} \ No newline at end of file +} diff --git a/src/operations/mod.rs b/src/operations/mod.rs index 442b40c..c0d64c3 100644 --- a/src/operations/mod.rs +++ b/src/operations/mod.rs @@ -1,9 +1,9 @@ use clap::ArgMatches; -mod init; mod build; -mod pull; mod config; +mod init; +mod pull; pub fn reinit() { init::reinit(); @@ -23,4 +23,4 @@ pub fn pull(matches: &ArgMatches) { pub fn config() { config::config(); -} \ No newline at end of file +} diff --git a/src/operations/pull.rs b/src/operations/pull.rs index 78769e7..fe7bded 100644 --- a/src/operations/pull.rs +++ b/src/operations/pull.rs @@ -1,7 +1,7 @@ +use crate::{info, workspace}; +use clap::ArgMatches; use std::env; use std::process::Command; -use clap::ArgMatches; -use crate::{info, workspace}; pub fn pull(matches: &ArgMatches) { let packages: Vec = matches @@ -46,4 +46,4 @@ pub fn pull(matches: &ArgMatches) { env::set_current_dir(&cdir).unwrap(); } } -} \ No newline at end of file +}