Skip to content

Commit 8319b68

Browse files
joyeecheunggibfahn
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 5d06a4f commit 8319b68

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
@@ -544,7 +544,8 @@ apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
544544

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

547-
doc-only: $(apidocs_html) $(apidocs_json)
547+
doc-targets: $(apidocs_html) $(apidocs_json)
548+
doc-only: | install-yaml doc-targets
548549
doc: $(NODE_EXE) doc-only
549550

550551
$(apidoc_dirs):
@@ -561,15 +562,16 @@ gen-json = tools/doc/generate.js --format=json $< > $@
561562
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
562563
--template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@
563564

564-
gen-doc = \
565+
install-yaml:
565566
[ -e tools/doc/node_modules/js-yaml/package.json ] || \
566567
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
567568
if [ -x $(NODE) ]; then \
568569
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
569570
else \
570571
cd tools/doc && node ../../$(NPM) install; \
571-
fi;\
572-
[ -x $(NODE) ] && $(NODE) $(1) || node $(1)
572+
fi;
573+
574+
gen-doc = [ -x $(NODE) ] && $(NODE) $(1) || node $(1)
573575

574576
out/doc/api/%.json: doc/api/%.md
575577
@$(call gen-doc, $(gen-json))
@@ -1155,6 +1157,7 @@ lint-clean:
11551157
install \
11561158
install-bin \
11571159
install-includes \
1160+
install-yaml \
11581161
lint \
11591162
lint-clean \
11601163
lint-ci \

0 commit comments

Comments
 (0)