diff options
author | Rahul P | 2020-08-08 20:30:16 +0530 |
---|---|---|
committer | GitHub | 2020-08-08 20:30:16 +0530 |
commit | 685bc96bcef1109164d879492449e54b2f6baf08 (patch) | |
tree | 5f94a7dad0a5af4a16015517f118c89ef8eac205 | |
parent | 1121b340fc2ff31c514802da5f5f4338133d2fb3 (diff) | |
parent | 296c71d931db518b6326088a47ee2e8c9abc587b (diff) | |
download | nghdl-685bc96bcef1109164d879492449e54b2f6baf08.tar.gz nghdl-685bc96bcef1109164d879492449e54b2f6baf08.tar.bz2 nghdl-685bc96bcef1109164d879492449e54b2f6baf08.zip |
Merge pull request #59 from rahulp13/installers
moved error on exit to install section only
-rwxr-xr-x | Ubuntu/install-nghdl.sh | 25 |
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 |