8024200: handle hg wrapper with space after #!
authormduigou
Tue, 03 Sep 2013 15:23:16 -0700
changeset 19752 935eac795255
parent 19522 9369c2c7a4d9
child 19753 2d003ca3bfb2
8024200: handle hg wrapper with space after #! Reviewed-by: tbell
common/bin/hgforest.sh
--- a/common/bin/hgforest.sh	Thu Aug 29 16:04:14 2013 -0700
+++ b/common/bin/hgforest.sh	Tue Sep 03 15:23:16 2013 -0700
@@ -47,7 +47,7 @@
 bpython=""
 
 if [ "#!" = "$has_hash_bang" ] ; then
-   python="`head -n 1 ${whichhg} | cut -b 3-`"
+   python="`head -n 1 ${whichhg} | cut -b 3- | sed -e 's/^[ \t]*//;s/[ \t]*$//'`"
    bpython="`basename "$python"`"
 fi