fix: honor positional input in save commands (#646)

This commit is contained in:
4paulpak
2026-04-14 21:33:13 +02:00
committed by GitHub
parent f9bc426b8f
commit a4e603a1d2
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -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()
+1 -3
View File
@@ -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 })