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
}
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 "==================="

Loading…
Cancel
Save