From 962fd757add484219b5a7d8daa15478fd04a7c33 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 4ab99b5bd31e30..657c9e3dc60516 100644 --- a/Makefile +++ b/Makefile @@ -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): @@ -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)) @@ -1155,6 +1157,7 @@ lint-clean: install \ install-bin \ install-includes \ + install-yaml \ lint \ lint-clean \ lint-ci \