X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-instaweb.sh;h=ad0723ccc64cc2cb7d0e79a165a68707d3ddfde7;hb=c5699693638d0471bf74425238d802d2bc9e8c0f;hp=8503ae40309e6c8b1547289c9950d99f4bf736b5;hpb=ab002e34e26c39a716dc80359450f739ba907122;p=git.git diff --git a/git-instaweb.sh b/git-instaweb.sh index 8503ae403..ad0723ccc 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -3,6 +3,7 @@ # Copyright (c) 2006 Eric Wong # +PERL='@@PERL@@' OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ git-instaweb [options] (--start | --stop | --restart) @@ -24,6 +25,7 @@ fqgitdir="$GIT_DIR" local="`git config --bool --get instaweb.local`" httpd="`git config --get instaweb.httpd`" browser="`git config --get instaweb.browser`" +test -z "$browser" && browser="`git config --get web.browser`" port=`git config --get instaweb.port` module_path="`git config --get instaweb.modulepath`" @@ -231,16 +233,18 @@ EOF } script=' -s#^\(my\|our\) $projectroot =.*#\1 $projectroot = "'$(dirname "$fqgitdir")'";# -s#\(my\|our\) $gitbin =.*#\1 $gitbin = "'$GIT_EXEC_PATH'";# -s#\(my\|our\) $projects_list =.*#\1 $projects_list = $projectroot;# -s#\(my\|our\) $git_temp =.*#\1 $git_temp = "'$fqgitdir/gitweb/tmp'";#' +s#^(my|our) \$projectroot =.*#$1 \$projectroot = "'$(dirname "$fqgitdir")'";#; +s#(my|our) \$gitbin =.*#$1 \$gitbin = "'$GIT_EXEC_PATH'";#; +s#(my|our) \$projects_list =.*#$1 \$projects_list = \$projectroot;#; +s#(my|our) \$git_temp =.*#$1 \$git_temp = "'$fqgitdir/gitweb/tmp'";#;' gitweb_cgi () { cat > "$1.tmp" <<\EOFGITWEB @@GITWEB_CGI@@ EOFGITWEB - sed "$script" "$1.tmp" > "$1" + # Use the configured full path to perl to match the generated + # scripts' 'hashpling' line + "$PERL" -p -e "$script" "$1.tmp" > "$1" chmod +x "$1" rm -f "$1.tmp" } @@ -272,4 +276,4 @@ esac start_httpd url=http://127.0.0.1:$port -"$browser" $url || echo $url +test -n "$browser" && "$browser" $url || echo $url