summary refs log tree commit diff stats
path: root/tools/niminst
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-12-31 03:00:30 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-12-31 03:00:39 +0100
commit072f932575965b55adc55beb1bb8d61e10122257 (patch)
tree3fb5de28efd24fd73d3bae0420dc0564e4aeef34 /tools/niminst
parentadf8eea4df79b2199877911aec880c66d7273a21 (diff)
downloadNim-072f932575965b55adc55beb1bb8d61e10122257.tar.gz
niminst: remove complex non-posix line noise for install.tmpl
Diffstat (limited to 'tools/niminst')
-rw-r--r--tools/niminst/install.tmpl30
1 files changed, 1 insertions, 29 deletions
diff --git a/tools/niminst/install.tmpl b/tools/niminst/install.tmpl
index d72b132ef..91504891d 100644
--- a/tools/niminst/install.tmpl
+++ b/tools/niminst/install.tmpl
@@ -3,35 +3,7 @@
 #  result = "#! /bin/sh\n# Generated by niminst\n"
 #  var proj = c.name.toLowerAscii
 
-## Current directory you start script from
-BASE_DIR=$(pwd)
-
-## The following one-liner takes directory path which contains install script.
-## `command -v -- "$0"` takes path if script sourced from interactive shell
-## `dirname` returns relative directory path to install script
-## `cd -P` dive into directory to use `pwd`
-## `pwd -P` prints full path to install script directory path
-## -P option allows to use symlinks in path
-## Good explanation can be found here:
-## http://stackoverflow.com/questions/29832037/how-to-get-script-directory-in-posix-sh
-NIM_DIR=$(cd -P -- "$(dirname -- "$(command -v -- "$0")")" && pwd -P)
-
-go_back() {
-  cd $BASE_DIR
-}
-
-## Go to base dir on exit
-trap go_back EXIT
-
-install_error() {
-  echo "Nim installation failed!"
-  exit 1
-}
-
-## Exit if any command failed
-trap install_error ERR ## `set -e` alternative
-
-cd $NIM_DIR
+set -e
 
 if [ $# -eq 1 ] ; then
 # if c.cat[fcUnixBin].len > 0: