Browse Source

trap any error

bookworm
pvincent 3 years ago
parent
commit
805aabbcb5
  1. 8
      src/main

8
src/main

@ -13,13 +13,13 @@ function trap_error(){
exit $error_code exit $error_code
} }
set -e
trap 'trap_error $? $LINENO' ERR
function runVoid(){ function runVoid(){
trap - ERR
local COMMAND="$@" local COMMAND="$@"
bash -c "${COMMAND}" >/dev/null 2>&1 bash -c "${COMMAND}" >/dev/null 2>&1
trap 'trap_error $? $LINENO' ERR
return $? return $?
} }
@ -63,6 +63,10 @@ REQUIRED_PACKAGES=( \
[ `id -u` -eq 0 ] && echo 'normal user required' && exit -1 [ `id -u` -eq 0 ] && echo 'normal user required' && exit -1
echo "# updating repositories"
echo "==================="
sudo apt update
echo "# required packages" echo "# required packages"
echo "===================" echo "==================="

Loading…
Cancel
Save