From e8f9a1fb8ef9f410cb1d58b51a716a7e4dd24109 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 7 Jul 2016 18:36:54 +0300 Subject: [PATCH] Use web.browser and browser.cmd from git config to get browser --- git-open | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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`" -- 2.39.5