From 8b8dcc050a2cfd85d2c5850bd452c45c1bbdda6f Mon Sep 17 00:00:00 2001 From: Srijan R Shetty Date: Mon, 21 Sep 2020 19:05:58 +0530 Subject: [PATCH] fix: use trap to run bye on errexit (#581) --- deploy/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/install.sh b/deploy/install.sh index 63e162bb68..9957cfd2be 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -308,6 +308,7 @@ echo_contact_support() { } bye() { # Prints a friendly good bye message and exits the script. + set +o errexit echo "Please share your email to receive support with the installation" read -rp 'Email: ' email curl -s -O --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ @@ -335,6 +336,9 @@ echo -e "\U1F575 Detecting your OS" check_os APPSMITH_INSTALLATION_ID=$(curl -s 'https://api6.ipify.org') +# Run bye if failure happens +trap bye EXIT + curl -s -O --location --request POST 'https://hook.integromat.com/dkwb6i52am93pi30ojeboktvj32iw0fa' \ --header 'Content-Type: text/plain' \ --data-raw '{