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 gibfahn committed Dec 19, 2017
1 parent 7737d11 commit 962fd75
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 @@ -544,7 +544,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 @@ -561,15 +562,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 @@ -1155,6 +1157,7 @@ lint-clean:
install \
install-bin \
install-includes \
install-yaml \
lint \
lint-clean \
lint-ci \
Expand Down

0 comments on commit 962fd75

Please sign in to comment.