Do not rely on "type -p"
authorFrej Drejhammar <frej.drejhammar@gmail.com>
Tue, 23 Sep 2014 13:01:02 +0000 (15:01 +0200)
committerFrej Drejhammar <frej.drejhammar@gmail.com>
Tue, 23 Sep 2014 13:01:02 +0000 (15:01 +0200)
Apparently dash (used as bin/sh on Ubuntu) does not support type -p.

Thanks to Esben Madsen for noticing and suggesting a fix.

hg-fast-export.sh

index e44d76d..3747fc6 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2007, 2008 Rocco Rutte <pdmef@gmx.net> and others.
 # License: MIT <http://www.opensource.org/licenses/mit-license.php>
 
-ROOT="`dirname "$(type -p $0)"`"
+ROOT="$(dirname "$(which "$0")")"
 REPO=""
 PFX="hg2git"
 SFX_MAPPING="mapping"