bin: nitc does no more rely on procfs
authorJean Privat <jean@pryen.org>
Sun, 2 Nov 2014 16:01:39 +0000 (11:01 -0500)
committerJean Privat <jean@pryen.org>
Mon, 3 Nov 2014 15:02:09 +0000 (10:02 -0500)
procfs (/proc/) does not exists on some system (macosx).
So use `$BASH_SOURCE` to approximate the original source-file.

Maybe we should just rename back nitg to nitc.

Reported-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

bin/nitc

index cd4c670..42b4e3a 100755 (executable)
--- a/bin/nitc
+++ b/bin/nitc
@@ -1,4 +1,3 @@
 #!/bin/bash
-self=`readlink /proc/$$/fd/255`
-dir=`dirname "$self"`
+dir=`dirname "$BASH_SOURCE"`
 exec "$dir/nitg" "$@"