Browse Source

trap any error

bookworm
pvincent 3 years ago
parent
commit
99598aa60c
  1. 16
      src/main

16
src/main

@ -3,6 +3,20 @@
## FUNCTIONS
## ---------
function trap_error(){
error_code=$1
error_line=$2
printf "\nEXIT #${error_code} due to error at line ${error_line} : \n-----------------------------------------\n"
sed "${error_line}q;d" $0
echo
exit $error_code
}
set -e
trap 'trap_error $? $LINENO' ERR
function runVoid(){
local COMMAND="$@"
bash -c "${COMMAND}" >/dev/null 2>&1
@ -225,6 +239,8 @@ for addon_id in "${!FIREFOX_ADDONS[@]}"; do
fi
done
echo
echo
echo "# DEBIAN-GNOME successfully installed!"

Loading…
Cancel
Save