X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-web--browse.sh;h=384148a59fc492d8fb1d6ea4fc4532aa1e5ffc22;hb=efb98b44536300f5daed25da3650033a1ce7fdef;hp=1023b9085989aecfdcdc161232ee22de866d5f57;hpb=923d44aeb7cb6d21eeb459fdc1b58137e37c2b1c;p=git.git diff --git a/git-web--browse.sh b/git-web--browse.sh index 1023b9085..384148a59 100755 --- a/git-web--browse.sh +++ b/git-web--browse.sh @@ -23,12 +23,18 @@ USAGE='[--browser=browser|--tool=browser] [--config=conf.var] url/file ...' NONGIT_OK=Yes . git-sh-setup +valid_custom_tool() +{ + browser_cmd="$(git config "browser.$1.cmd")" + test -n "$browser_cmd" +} + valid_tool() { case "$1" in firefox | iceweasel | konqueror | w3m | links | lynx | dillo | open) ;; # happy *) - return 1 + valid_custom_tool "$1" || return 1 ;; esac } @@ -122,7 +128,7 @@ else init_browser_path "$browser" - if ! type "$browser_path" > /dev/null 2>&1; then + if test -z "$browser_cmd" && ! type "$browser_path" > /dev/null 2>&1; then die "The browser $browser is not available as '$browser_path'." fi fi @@ -157,4 +163,9 @@ case "$browser" in dillo) "$browser_path" "$@" & ;; + *) + if test -n "$browser_cmd"; then + ( eval $browser_cmd "$@" ) + fi + ;; esac