From 2f56563746aaa35a1c45f1ffc4cb9d192f5b5b9f Mon Sep 17 00:00:00 2001 From: Michal Date: Sun, 24 Jul 2022 16:12:12 +0100 Subject: [PATCH] Added crash for prune in workspace mode --- src/main.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d9771f5..f4eb576 100755 --- a/src/main.rs +++ b/src/main.rs @@ -57,13 +57,21 @@ fn main() { if !repository { crash!( AppExitCode::BuildInWorkspace, - "Cannot build packages in workspace mode" + "Cannot generate repository in workspace mode" ); } repository::generate(verbose); } Operation::Config => operations::config(verbose), - Operation::Prune => operations::prune(verbose), + Operation::Prune => { + if !repository { + crash!( + AppExitCode::BuildInWorkspace, + "Cannot prune packages in workspace mode" + ); + } + operations::prune(verbose) + }, Operation::Clean => operations::clean(verbose), Operation::Info => operations::info(verbose), }