From a4e603a1d2eb710a652b670027f50259c676b7e7 Mon Sep 17 00:00:00 2001 From: 4paulpak <36824673+4paulpak@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:33:13 +0200 Subject: [PATCH] fix: honor positional input in save commands (#646) --- src/email/message/command/save.rs | 2 +- src/email/message/template/command/save.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/email/message/command/save.rs b/src/email/message/command/save.rs index 6509bc49..e0ff0036 100644 --- a/src/email/message/command/save.rs +++ b/src/email/message/command/save.rs @@ -61,7 +61,7 @@ impl MessageSaveCommand { let is_tty = io::stdin().is_terminal(); let is_json = printer.is_json(); - let msg = if is_tty || is_json { + let msg = if !self.message.raw.is_empty() || is_tty || is_json { self.message.raw() } else { io::stdin() diff --git a/src/email/message/template/command/save.rs b/src/email/message/template/command/save.rs index 1570b99c..7791e6b1 100644 --- a/src/email/message/template/command/save.rs +++ b/src/email/message/template/command/save.rs @@ -67,7 +67,7 @@ impl TemplateSaveCommand { let is_tty = io::stdin().is_terminal(); let is_json = printer.is_json(); - let tpl = if is_tty || is_json { + let tpl = if !self.template.raw.is_empty() || is_tty || is_json { self.template.raw() } else { io::stdin() @@ -86,8 +86,6 @@ impl TemplateSaveCommand { let msg = compiler.build(tpl.as_str())?.compile().await?.into_vec()?; - backend.add_message(folder, &msg).await?; - let id = backend.add_message(folder, &msg).await?; printer.out(TemplateAdded { folder, id })