@matheusbsbs / matheus-bagliano / commits / 2e0c290299
Fork 0

instaweb: use 'git-web--browse' to launch browser.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Feb 2, 2008 at 07:32 UTC 2e0c290299e381884e4f4a4efb847fc8ecc4647c
1 file changed +6 -14
git-instaweb.sh
+6 -14
@@ -24,8 +24,6 @@ restart restart the web server
24 fqgitdir="$GIT_DIR"
25 local="`git config --bool --get instaweb.local`"
26 httpd="`git config --get instaweb.httpd`"
27 -browser="`git config --get instaweb.browser`"
28 -test -z "$browser" && browser="`git config --get web.browser`"
27 port=`git config --get instaweb.port`
28 module_path="`git config --get instaweb.modulepath`"
29
@@ -36,9 +34,6 @@ conf="$GIT_DIR/gitweb/httpd.conf"
34 # if installed, it doesn't need further configuration (module_path)
35 test -z "$httpd" && httpd='lighttpd -f'
36
39 -# probably the most popular browser among gitweb users
40 -test -z "$browser" && browser='firefox'
41 -
37 # any untaken local port will do...
38 test -z "$port" && port=1234
39
@@ -274,14 +269,11 @@ webrick)
269 ;;
270 esac
271
277 -init_browser_path() {
278 - browser_path="`git config browser.$1.path`"
279 - test -z "$browser_path" && browser_path="$1"
280 -}
281 -
272 start_httpd
273 url=http://127.0.0.1:$port
284 -test -n "$browser" && {
285 - init_browser_path "$browser"
286 - "$browser_path" $url
287 -} || echo $url
274 +
275 +if test -n "$browser"; then
276 + git web--browse -b "$browser" $url || echo $url
277 +else
278 + git web--browse -c "instaweb.browser" $url || echo $url
279 +fi