diff --git a/modules/node/functions/node-doc b/modules/node/functions/node-doc index 155b131..0623a56 100644 --- a/modules/node/functions/node-doc +++ b/modules/node/functions/node-doc @@ -5,6 +5,11 @@ # Sorin Ionescu # -# TODO: Make the sections easier to use. -open "http://nodejs.org/docs/$(node --version | sed 's/-.*//')/api/all.html#${1}" +if [[ -z "$BROWSER" ]]; then + print "$0: no web browser defined" >&2 + return 1 +fi + +# TODO: Make the sections easier to use. +"$BROWSER" "http://nodejs.org/docs/$(node --version | sed 's/-.*//')/api/all.html#${1}"