Skip to content

Commit

Permalink
tools: try installing js-yaml only once
Browse files Browse the repository at this point in the history
PR-URL: #16661
Fixes: #16650
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
joyeecheung authored and MylesBorins committed Dec 11, 2017
1 parent d74c7c5 commit 7fe6a8f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets

apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

doc-only: $(apidocs_html) $(apidocs_json)
doc-targets: $(apidocs_html) $(apidocs_json)
doc-only: | install-yaml doc-targets
doc: $(NODE_EXE) doc-only

$(apidoc_dirs):
Expand All @@ -556,15 +557,16 @@ gen-json = tools/doc/generate.js --format=json $< > $@
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
--template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@

gen-doc = \
install-yaml:
[ -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) $(1) || node $(1)
fi;

gen-doc = [ -x $(NODE) ] && $(NODE) $(1) || node $(1)

out/doc/api/%.json: doc/api/%.md
@$(call gen-doc, $(gen-json))
Expand Down Expand Up @@ -1150,6 +1152,7 @@ lint-clean:
install \
install-bin \
install-includes \
install-yaml \
lint \
lint-clean \
lint-ci \
Expand Down

0 comments on commit 7fe6a8f

Please sign in to comment.