From 0273ee34b171d9d16b78102ca5d119341625b8ed Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 10 Jun 2024 14:11:25 +0200 Subject: [PATCH] helpers2.1: remove ugly legacy eval trick in ynh_exec_warn_less --- helpers/helpers.v2.1.d/logging | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/helpers/helpers.v2.1.d/logging b/helpers/helpers.v2.1.d/logging index 06b8d5083..4721b45dc 100644 --- a/helpers/helpers.v2.1.d/logging +++ b/helpers/helpers.v2.1.d/logging @@ -61,16 +61,8 @@ ynh_print_warn() { # # Requires YunoHost version 3.2.0 or higher. ynh_exec_warn_less() { - # Boring legacy handling for when people calls ynh_exec_* wrapping the command in quotes, - # (because in the past eval was used) ... - # we detect this by checking that there's no 2nd arg, and $1 contains a space - if [[ "$#" -eq 1 ]] && [[ "$1" == *" "* ]] - then - eval $@ 2>&1 - else - # Note that "$@" is used and not $@, c.f. https://unix.stackexchange.com/a/129077 - "$@" 2>&1 - fi + # Note that "$@" is used and not $@, c.f. https://unix.stackexchange.com/a/129077 + "$@" 2>&1 } # Execute a command and redirect stderr in /dev/null. Print stderr on error.