forked from Shinonome/dots-hyprland
Move trap to each needed subcommand
This commit is contained in:
@@ -8,10 +8,6 @@ source ./sdata/lib/package-installers.sh
|
||||
source ./sdata/lib/dist-determine.sh
|
||||
|
||||
prevent_sudo_or_root
|
||||
|
||||
# Trap to ensure sudo keepalive is stopped on exit
|
||||
trap sudo_stop_keepalive EXIT INT TERM
|
||||
|
||||
set -e
|
||||
|
||||
#####################################################################################
|
||||
@@ -77,6 +73,8 @@ case ${SUBCMD_NAME} in
|
||||
pause
|
||||
# Initialize sudo keepalive for the entire install process
|
||||
sudo_init_keepalive
|
||||
# Set trap to cleanup when this subcommand exits
|
||||
trap sudo_stop_keepalive EXIT INT TERM
|
||||
if [[ "${SKIP_ALLGREETING}" != true ]]; then
|
||||
source ${SUBCMD_DIR}/0.greeting.sh
|
||||
fi
|
||||
@@ -97,6 +95,8 @@ case ${SUBCMD_NAME} in
|
||||
pause
|
||||
# Initialize sudo keepalive for dependency installation
|
||||
sudo_init_keepalive
|
||||
# Set trap to cleanup when this subcommand exits
|
||||
trap sudo_stop_keepalive EXIT INT TERM
|
||||
if [[ "${SKIP_ALLDEPS}" != true ]]; then
|
||||
source ${SUBCMD_DIR}/1.deps-router.sh
|
||||
fi
|
||||
@@ -108,6 +108,8 @@ case ${SUBCMD_NAME} in
|
||||
pause
|
||||
# Initialize sudo keepalive for setup steps
|
||||
sudo_init_keepalive
|
||||
# Set trap to cleanup when this subcommand exits
|
||||
trap sudo_stop_keepalive EXIT INT TERM
|
||||
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
|
||||
source ${SUBCMD_DIR}/2.setups.sh
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user