summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrahulp132020-08-08 00:36:05 +0530
committerrahulp132020-08-08 00:36:05 +0530
commit296c71d931db518b6326088a47ee2e8c9abc587b (patch)
tree5f94a7dad0a5af4a16015517f118c89ef8eac205
parent6078e090b7d6f8caca18b5f21a2c265a8853c063 (diff)
downloadnghdl-296c71d931db518b6326088a47ee2e8c9abc587b.tar.gz
nghdl-296c71d931db518b6326088a47ee2e8c9abc587b.tar.bz2
nghdl-296c71d931db518b6326088a47ee2e8c9abc587b.zip
moved error on exit to install section only
-rwxr-xr-xUbuntu/install-nghdl.sh25
1 files changed, 13 insertions, 12 deletions
diff --git a/Ubuntu/install-nghdl.sh b/Ubuntu/install-nghdl.sh
index fcb3eab..8450a4b 100755
--- a/Ubuntu/install-nghdl.sh
+++ b/Ubuntu/install-nghdl.sh
@@ -18,18 +18,6 @@
# REVISION: Sunday 02 August 2020 01:35
#===============================================================================
-set -e # Set exit option immediately on error
-set -E # inherit ERR trap by shell functions
-
-error_exit() {
- echo -e "\n\nError! Kindly resolve above error(s) and try again."
- echo -e "\nAborting Installation...\n"
-}
-
-# Trap on function error_exit before exiting on error
-trap error_exit ERR
-
-
ngspice="ngspice-nghdl"
ghdl="ghdl-0.37"
config_dir="$HOME/.nghdl"
@@ -42,6 +30,13 @@ timestamp=`echo $sysdate|awk '{print $3"_"$2"_"$6"_"$4 }'`
# All functions goes here
+
+error_exit() {
+ echo -e "\n\nError! Kindly resolve above error(s) and try again."
+ echo -e "\nAborting Installation...\n"
+}
+
+
function installDependency
{
@@ -215,6 +210,12 @@ fi
## Checking flags
if [ $option == "--install" ];then
+ set -e # Set exit option immediately on error
+ set -E # inherit ERR trap by shell functions
+
+ # Trap on function error_exit before exiting on error
+ trap error_exit ERR
+
#Calling functions
installDependency
if [ $? -ne 0 ];then