From 6676ddafcc393537dbad3cbf0b821b1f79fa6868 Mon Sep 17 00:00:00 2001 From: kevinnls <57634663+kevinnls@users.noreply.github.com> Date: Wed, 17 Mar 2021 01:41:16 +0530 Subject: [PATCH] add `trap` to installation script --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 1039824..1ad53fc 100755 --- a/install.sh +++ b/install.sh @@ -149,9 +149,11 @@ cleanup(){ # cleanup cd "$HOME" rm -rf "$work_dir" - exit $1 + exit ${1-0} } +trap "cleanup 1" SIGHUP SIGINT SIGTERM ERR + install(){ setup find_dler