From: Oleg Broytman Date: Thu, 7 Jul 2016 15:36:54 +0000 (+0300) Subject: Use web.browser and browser.cmd from git config to get browser X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=e8f9a1fb8ef9f410cb1d58b51a716a7e4dd24109 Use web.browser and browser.cmd from git config to get browser --- diff --git a/git-open b/git-open index ab70471..435ef9a 100755 --- a/git-open +++ b/git-open @@ -1,2 +1,8 @@ #! /bin/sh -exec webbrowser -n "`git config --get remote.$1.url`" + +browser_section="`git config --get web.browser`" +browser_cmd="`git config --get browser.\"$browser_section\".cmd`" +if [ -z "$browser_cmd" ]; then + browser_cmd="webbrowser -n" +fi +exec $browser_cmd "`git config --get remote.$1.url`"