From c94a7614ad4a5a89dcc7eae6eec239da0e0acda9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 30 Sep 2020 18:43:11 +0200 Subject: [PATCH] Only restore set -x option if it was previously set --- data/helpers | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/helpers b/data/helpers index 5ec562f61..e1b26db5c 100644 --- a/data/helpers +++ b/data/helpers @@ -1,8 +1,8 @@ # -*- shell-script -*- +readonly XTRACE_ENABLE=$(set +o | grep xtrace) # This is a trick to later only restore set -x if it was set when calling this script set +x for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null) ; do [ -r $helper ] && . $helper || true done -set -x - +eval "$XTRACE_BKP"