Avoid 'expr index' on Mac OS X as it isn't supported
This fixes git-instaweb so it can start an httpd without warning about an invalid test command. Yes its ugly, but its also quite portable. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
46eb449cbe
commit
f5f30699c0
@ -30,8 +30,7 @@ test -z "$port" && port=1234
|
|||||||
|
|
||||||
start_httpd () {
|
start_httpd () {
|
||||||
httpd_only="`echo $httpd | cut -f1 -d' '`"
|
httpd_only="`echo $httpd | cut -f1 -d' '`"
|
||||||
if test "`expr index $httpd_only /`" -eq '1' || \
|
if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac
|
||||||
which $httpd_only >/dev/null
|
|
||||||
then
|
then
|
||||||
$httpd $fqgitdir/gitweb/httpd.conf
|
$httpd $fqgitdir/gitweb/httpd.conf
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user