]> git.phdru.name Git - git-scripts.git/commitdiff
Use web.browser and browser.cmd from git config to get browser
authorOleg Broytman <phd@phdru.name>
Thu, 7 Jul 2016 15:36:54 +0000 (18:36 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 7 Jul 2016 15:36:54 +0000 (18:36 +0300)
git-open

index ab704711ae13a6618912d1adf07baebb69282c17..435ef9a186fe4c670cd84f5d72344d22ff360981 100755 (executable)
--- 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`"