Skip to content

Commit 7fe6a8f

Browse files
joyeecheungMylesBorins
authored andcommitted
tools: try installing js-yaml only once
PR-URL: #16661 Fixes: #16650 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent d74c7c5 commit 7fe6a8f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Makefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
539539

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

542-
doc-only: $(apidocs_html) $(apidocs_json)
542+
doc-targets: $(apidocs_html) $(apidocs_json)
543+
doc-only: | install-yaml doc-targets
543544
doc: $(NODE_EXE) doc-only
544545

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

559-
gen-doc = \
560+
install-yaml:
560561
[ -e tools/doc/node_modules/js-yaml/package.json ] || \
561562
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
562563
if [ -x $(NODE) ]; then \
563564
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
564565
else \
565566
cd tools/doc && node ../../$(NPM) install; \
566-
fi;\
567-
[ -x $(NODE) ] && $(NODE) $(1) || node $(1)
567+
fi;
568+
569+
gen-doc = [ -x $(NODE) ] && $(NODE) $(1) || node $(1)
568570

569571
out/doc/api/%.json: doc/api/%.md
570572
@$(call gen-doc, $(gen-json))
@@ -1150,6 +1152,7 @@ lint-clean:
11501152
install \
11511153
install-bin \
11521154
install-includes \
1155+
install-yaml \
11531156
lint \
11541157
lint-clean \
11551158
lint-ci \

0 commit comments

Comments
 (0)