From 67b3e57fcd3d2e6d4f7ff8490e6a471518b1302d Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 25 Jul 2022 11:53:15 +0100 Subject: [PATCH] Fixed issue w/ config creation requiring existing config --- src/main.rs | 28 +++++++++++++++++++++------- src/repository/config.rs | 5 ++++- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 55143fc..ba89d9b 100755 --- a/src/main.rs +++ b/src/main.rs @@ -30,13 +30,6 @@ fn main() { log!(verbose, "Exclude: {:?}", exclude); log!(verbose, "Verbose: You guess. :)"); - // Parse config - let config = parse_cfg(verbose); - log!(verbose, "Config: {:?}", config); - - // Get repository mode status - let repository = config.base.mode == "repository"; - log!(verbose, "Repository Mode: {:?}", repository); // Arg matching match args.subcommand.unwrap_or(Operation::Clone) { @@ -44,6 +37,13 @@ fn main() { Operation::Build { packages, no_regen, .. } => { + // Parse config + let config = parse_cfg(verbose); + log!(verbose, "Config: {:?}", config); + + // Get repository mode status + let repository = config.base.mode == "repository"; + log!(verbose, "Repository Mode: {:?}", repository); if !repository { crash!( AppExitCode::BuildInWorkspace, @@ -56,6 +56,13 @@ fn main() { packages, no_regen, .. } => operations::pull(packages, exclude, verbose, no_regen), Operation::RepoGen => { + // Parse config + let config = parse_cfg(verbose); + log!(verbose, "Config: {:?}", config); + + // Get repository mode status + let repository = config.base.mode == "repository"; + log!(verbose, "Repository Mode: {:?}", repository); if !repository { crash!( AppExitCode::BuildInWorkspace, @@ -66,6 +73,13 @@ fn main() { } Operation::Config => operations::config(verbose), Operation::Prune => { + // Parse config + let config = parse_cfg(verbose); + log!(verbose, "Config: {:?}", config); + + // Get repository mode status + let repository = config.base.mode == "repository"; + log!(verbose, "Repository Mode: {:?}", repository); if !repository { crash!( AppExitCode::BuildInWorkspace, diff --git a/src/repository/config.rs b/src/repository/config.rs index c432dd5..2e182c1 100644 --- a/src/repository/config.rs +++ b/src/repository/config.rs @@ -24,7 +24,10 @@ build_on_update = false enabled = true [mode.workspace] -# There are currently no options for workspace mode +# Whether to show rich git info for repositories +git_info = true +# Colorblind mode toggle +colorblind = false [repositories] # List of repositories formatted as id:name (priority is decided by the ! suffix, and decides package build order)