mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-15 20:07:57 +08:00
fix: honor positional input in save commands (#646)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user