feat: replace binary detection with text metadata check
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -43,10 +43,10 @@ pub fn mode_get(
|
||||
|
||||
if detect_binary {
|
||||
let meta_map = item_with_meta.meta_as_map();
|
||||
if let Some(binary_val) = meta_map.get("binary") {
|
||||
if binary_val == "false" {
|
||||
if let Some(text_val) = meta_map.get("text") {
|
||||
if text_val == "true" {
|
||||
detect_binary = false;
|
||||
} else if binary_val == "true" {
|
||||
} else if text_val == "false" {
|
||||
return Err(anyhow!(
|
||||
"Refusing to output binary data to TTY, use --force to override"
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user