From 7987e01d72ea5eeee706f4d0dc8e773f23604002 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Wed, 13 Oct 2021 22:03:30 +0200 Subject: [PATCH] fix(render): pprevent the shell extension from failing if stderr is not empty but process exits successfully. Fix #563 --- espanso-render/src/extension/shell.rs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/espanso-render/src/extension/shell.rs b/espanso-render/src/extension/shell.rs index a385a5b..3979acd 100644 --- a/espanso-render/src/extension/shell.rs +++ b/espanso-render/src/extension/shell.rs @@ -24,7 +24,7 @@ use std::{ }; use crate::{Extension, ExtensionOutput, ExtensionResult, Params, Value}; -use log::{info, warn}; +use log::{error, info}; use thiserror::Error; #[allow(clippy::upper_case_acronyms)] @@ -191,23 +191,15 @@ impl Extension for ShellExtension { info!("this debug information was shown because the 'debug' option is true."); } - let ignore_error = params - .get("ignore_error") - .and_then(|v| v.as_bool()) - .copied() - .unwrap_or(false); - - if !output.status.success() || !error_str.trim().is_empty() { - warn!( + if !output.status.success() { + error!( "shell command exited with code: {} and error: {}", output.status, error_str ); - if !ignore_error { - return ExtensionResult::Error( - ShellExtensionError::ExecutionError(error_str.to_string()).into(), - ); - } + return ExtensionResult::Error( + ShellExtensionError::ExecutionError(error_str.to_string()).into(), + ); } let trim = params