build: run npm install
for doc builds in tarball
Run `npm install` before building the documentation from release tarballs. The doctool currently depends on `js-yaml`, which is imported from the `tools/eslint` subtree; however, release tarballs don’t contain that directory. Running `npm install` is clearly not a beautiful solution, but it works. Fixes: https://github.com/nodejs/node/issues/7872 PR-URL: https://github.com/nodejs/node/pull/8413 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
2eb3fa14f8
commit
9391cb0fde
15
Makefile
15
Makefile
@ -39,6 +39,7 @@ EXEEXT := $(shell $(PYTHON) -c \
|
|||||||
NODE_EXE = node$(EXEEXT)
|
NODE_EXE = node$(EXEEXT)
|
||||||
NODE ?= ./$(NODE_EXE)
|
NODE ?= ./$(NODE_EXE)
|
||||||
NODE_G_EXE = node_g$(EXEEXT)
|
NODE_G_EXE = node_g$(EXEEXT)
|
||||||
|
NPM ?= ./deps/npm/bin/npm-cli.js
|
||||||
|
|
||||||
# Flags for packaging.
|
# Flags for packaging.
|
||||||
BUILD_DOWNLOAD_FLAGS ?= --download=all
|
BUILD_DOWNLOAD_FLAGS ?= --download=all
|
||||||
@ -311,11 +312,25 @@ out/doc/%: doc/%
|
|||||||
# check if ./node is actually set, else use user pre-installed binary
|
# check if ./node is actually set, else use user pre-installed binary
|
||||||
gen-json = tools/doc/generate.js --format=json $< > $@
|
gen-json = tools/doc/generate.js --format=json $< > $@
|
||||||
out/doc/api/%.json: doc/api/%.md
|
out/doc/api/%.json: doc/api/%.md
|
||||||
|
[ -e tools/doc/node_modules/js-yaml/package.json ] || \
|
||||||
|
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
|
||||||
|
if [ -x $(NODE) ]; then \
|
||||||
|
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
|
||||||
|
else \
|
||||||
|
cd tools/doc && node ../../$(NPM) install; \
|
||||||
|
fi
|
||||||
[ -x $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json)
|
[ -x $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json)
|
||||||
|
|
||||||
# check if ./node is actually set, else use user pre-installed binary
|
# check if ./node is actually set, else use user pre-installed binary
|
||||||
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@
|
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@
|
||||||
out/doc/api/%.html: doc/api/%.md
|
out/doc/api/%.html: doc/api/%.md
|
||||||
|
[ -e tools/doc/node_modules/js-yaml/package.json ] || \
|
||||||
|
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
|
||||||
|
if [ -x $(NODE) ]; then \
|
||||||
|
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
|
||||||
|
else \
|
||||||
|
cd tools/doc && node ../../$(NPM) install; \
|
||||||
|
fi
|
||||||
[ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html)
|
[ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html)
|
||||||
|
|
||||||
docopen: out/doc/api/all.html
|
docopen: out/doc/api/all.html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user