From c4b50ec1a0a9cc4b747e5e693c4c7693bfbe288c Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 6 Oct 2014 18:02:45 -0400 Subject: [PATCH] [Fix #635] Use $BROWSER to open node documentation --- modules/node/functions/node-doc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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}"