From 7fe6a8f5d5d5f6340907f4ffada961dd6bd6f621 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 1 Nov 2017 12:13:18 +0800 Subject: [PATCH] tools: try installing js-yaml only once PR-URL: https://github.com/nodejs/node/pull/16661 Fixes: https://github.com/nodejs/node/issues/16650 Reviewed-By: James M Snell Reviewed-By: Richard Lau --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e29b486cec57ef..fce5d7146ad3df 100644 --- a/Makefile +++ b/Makefile @@ -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): @@ -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)) @@ -1150,6 +1152,7 @@ lint-clean: install \ install-bin \ install-includes \ + install-yaml \ lint \ lint-clean \ lint-ci \