From 68cfff1a430c829212dc095fe5fdd9ca689b6517 Mon Sep 17 00:00:00 2001 From: Shia Date: Mon, 23 Sep 2024 14:42:38 +0900 Subject: [PATCH] Do not show prompt on no diff apply --- src/commands/apply.rs | 4 ++++ src/differ.rs | 10 +++++++--- src/types/diff_result.rs | 10 ++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/commands/apply.rs b/src/commands/apply.rs index 1e20c54..0d60ef8 100644 --- a/src/commands/apply.rs +++ b/src/commands/apply.rs @@ -21,6 +21,10 @@ impl ApplyCommand { let diff_result = diff(context, config).await?; + if diff_result.no_change { + return Ok(()); + } + if !auto_approve { print!( r#" diff --git a/src/differ.rs b/src/differ.rs index c01f7cd..b2932ae 100644 --- a/src/differ.rs +++ b/src/differ.rs @@ -302,9 +302,13 @@ pub async fn diff(context: &FuburaContext, config: &Config) -> Result