Skip to content

Commit ec065b2

Browse files
nlflukekarrys
authored andcommitted
chore: fix Makefile for building markdown docs
1 parent 6b5c7df commit ec065b2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,22 @@ man/man7/%.7: docs/content/using-npm/%.md docs/bin/docs-build.js
7373
docs/content/using-npm/config.md: docs/bin/config-doc.js lib/utils/config/*.js
7474
node docs/bin/config-doc.js
7575

76-
docs/content/commands/npm-%.md: docs/bin/config-doc-command.js lib/commands/%.js lib/utils/config/*.js lib/utils/cmd-list.js
76+
mddocs: docs/bin/config-doc-command.js lib/utils/config/*.js lib/utils/cmd-list.js
77+
@for file in $(shell find docs/content/commands -name 'npm-*.md'); do \
78+
cmdname=$$(basename $$file .md) ;\
79+
cmdname=$${cmdname##npm-} ;\
80+
echo node docs/bin/config-doc-command.js $${file} lib/commands/$${cmdname}.js ;\
81+
node docs/bin/config-doc-command.js $${file} lib/commands/$${cmdname}.js ;\
82+
done
83+
84+
docs/content/commands/npm-%.md: lib/commands/%.js
7785
node docs/bin/config-doc-command.js $@ $<
7886

7987
freshdocs:
8088
touch lib/utils/config/definitions.js
8189
touch docs/bin/*.js
8290
make docs
91+
make mddocs
8392

8493
test-all: deps
8594
node bin/npm-cli.js run test-all
@@ -108,4 +117,4 @@ publish: gitclean ls-ok link test-all docs prune
108117
release: gitclean ls-ok docs prune
109118
@bash scripts/release.sh
110119

111-
.PHONY: all latest install dev link docs clean uninstall test-all man docsclean release ls-ok deps prune freshdocs
120+
.PHONY: all latest install dev link docs mddocs clean uninstall test-all man docsclean release ls-ok deps prune freshdocs

0 commit comments

Comments
 (0)