summaryrefslogtreecommitdiff
path: root/Ubuntu/install-nghdl.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Ubuntu/install-nghdl.sh')
-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