Merge pull request #267 from rivanfebrian123/master

Critical update: new error handling
This commit is contained in:
Vince 2021-05-28 00:30:05 +08:00 committed by GitHub
commit 4323bfa4ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 13 deletions

View file

@ -161,7 +161,7 @@ start_animation() {
}
stop_animation() {
kill -13 "${ANIM_PID}" &> /dev/null || true
[[ -e "/proc/${ANIM_PID}" ]] && kill -13 "${ANIM_PID}"
setterm -cursor on
}
@ -468,7 +468,7 @@ rootify() {
trap true SIGINT
prompt -w "Executing '$(echo "${@}" | cut -c -35 )...' as root"
sudo ${@} || operation_aborted
trap stop_animation SIGINT
trap signal_exit SIGINT
}
full_rootify() {
@ -481,7 +481,7 @@ full_rootify() {
userify() {
trap true SIGINT
sudo -u "${MY_USERNAME}" ${@} || operation_aborted
trap stop_animation SIGINT
trap signal_exit SIGINT
}
signal_exit() {
@ -543,6 +543,7 @@ finalize_argument_parsing() {
rm -rf "${WHITESUR_TMP_DIR}"; mkdir -p "${WHITESUR_TMP_DIR}"
rm -rf "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
exec 2> "${WHITESUR_TMP_DIR}/error_log.txt"
trap 'operation_aborted' ERR; trap 'signal_exit' SIGINT; trap 'signal_exit' EXIT
trap 'operation_aborted' ERR
trap 'signal_exit' INT EXIT TERM
fi
}

View file

@ -439,17 +439,19 @@ install_firefox_theme() {
}
config_firefox() {
killall "firefox" &> /dev/null
killall "firefox" &> /dev/null || true
for d in "${FIREFOX_DIR_HOME}/"*"default"*; do
rm -rf "${d}/chrome"
userify ln -sf "${FIREFOX_THEME_DIR}" "${d}/chrome"
userify_file "${d}/prefs.js"
echo "user_pref(\"toolkit.legacyUserProfileCustomizations.stylesheets\", true);" >> "${d}/prefs.js"
echo "user_pref(\"browser.tabs.drawInTitlebar\", true);" >> "${d}/prefs.js"
echo "user_pref(\"browser.uidensity\", 0);" >> "${d}/prefs.js"
echo "user_pref(\"layers.acceleration.force-enabled\", true);" >> "${d}/prefs.js"
echo "user_pref(\"mozilla.widget.use-argb-visuals\", true);" >> "${d}/prefs.js"
if [[ -f "${d}/prefs.js" ]]; then
rm -rf "${d}/chrome"
userify ln -sf "${FIREFOX_THEME_DIR}" "${d}/chrome"
userify_file "${d}/prefs.js"
echo "user_pref(\"toolkit.legacyUserProfileCustomizations.stylesheets\", true);" >> "${d}/prefs.js"
echo "user_pref(\"browser.tabs.drawInTitlebar\", true);" >> "${d}/prefs.js"
echo "user_pref(\"browser.uidensity\", 0);" >> "${d}/prefs.js"
echo "user_pref(\"layers.acceleration.force-enabled\", true);" >> "${d}/prefs.js"
echo "user_pref(\"mozilla.widget.use-argb-visuals\", true);" >> "${d}/prefs.js"
fi
done
}