Merge pull request #45911 from samueldr/fix/nixos-help-browser
nixos/manual: nixos-help knows about colon-separated BROWSER
This commit is contained in:
commit
146f8bac7e
|
@ -44,7 +44,13 @@ let
|
||||||
helpScript = pkgs.writeScriptBin "nixos-help"
|
helpScript = pkgs.writeScriptBin "nixos-help"
|
||||||
''
|
''
|
||||||
#! ${pkgs.runtimeShell} -e
|
#! ${pkgs.runtimeShell} -e
|
||||||
browser="$BROWSER"
|
# Finds first executable browser in a colon-separated list.
|
||||||
|
# (see how xdg-open defines BROWSER)
|
||||||
|
browser="$(
|
||||||
|
IFS=: ; for b in $BROWSER; do
|
||||||
|
[ -n "$(type -P "$b" || true)" ] && echo "$b" && break
|
||||||
|
done
|
||||||
|
)"
|
||||||
if [ -z "$browser" ]; then
|
if [ -z "$browser" ]; then
|
||||||
browser="$(type -P xdg-open || true)"
|
browser="$(type -P xdg-open || true)"
|
||||||
if [ -z "$browser" ]; then
|
if [ -z "$browser" ]; then
|
||||||
|
|
Loading…
Reference in New Issue