From 805aabbcb556cbe1b8779cfb3dde9a86e29ddc54 Mon Sep 17 00:00:00 2001 From: pvincent Date: Tue, 3 Aug 2021 18:36:46 +0400 Subject: [PATCH] trap any error --- src/main | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main b/src/main index e30e959..af18444 100755 --- a/src/main +++ b/src/main @@ -13,13 +13,13 @@ function trap_error(){ exit $error_code } -set -e -trap 'trap_error $? $LINENO' ERR function runVoid(){ + trap - ERR local COMMAND="$@" bash -c "${COMMAND}" >/dev/null 2>&1 + trap 'trap_error $? $LINENO' ERR return $? } @@ -63,6 +63,10 @@ REQUIRED_PACKAGES=( \ [ `id -u` -eq 0 ] && echo 'normal user required' && exit -1 +echo "# updating repositories" +echo "===================" +sudo apt update + echo "# required packages" echo "==================="