Skip to content

Commit c111cf2

Browse files
doc: make doc-only -> fallback to user binary
After the #3888 it was not possible to "make doc-only" in some situations. This now fallsback to any installed node version and throws "node not found" in error case. Ref: #3888 PR-URL: #6906 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 3ef2eb2 commit c111cf2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,15 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
278278
out/doc/%: doc/%
279279
cp -r $< $@
280280

281+
# check if ./node is actually set, else use user pre-installed binary
282+
gen-json = tools/doc/generate.js --format=json $< > $@
281283
out/doc/api/%.json: doc/api/%.md
282-
$(NODE) tools/doc/generate.js --format=json $< > $@
284+
[ -x $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json)
283285

286+
# check if ./node is actually set, else use user pre-installed binary
287+
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@
284288
out/doc/api/%.html: doc/api/%.md
285-
$(NODE) tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@
289+
[ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html)
286290

287291
docopen: out/doc/api/all.html
288292
-google-chrome out/doc/api/all.html

0 commit comments

Comments
 (0)