Skip to content

Commit 8069598

Browse files
committed
improved makefile by looping over example dirs
1 parent 7d6cd39 commit 8069598

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ BUILD_DIR = .build
22
TEST_DIR = .
33
SEMVER=prerelease --preid=beta
44

5+
EXAMPLES=$(dir $(wildcard examples/*/package.json))
6+
57
install:
68
npm install
79
npm run build
8-
cd examples/articles && npm install && npm link && npm run build;
9-
cd examples/blocks && npm install && npm link && npm run build;
10-
cd examples/masonry && npm install && npm link && npm run build;
10+
$(foreach ex,$(EXAMPLES),(cd $(ex) && npm install && npm run link && npm run build) || exit $$?;)
1111
.PHONY: install
1212

1313
update:
14-
cd examples/articles && npm update;
15-
cd examples/blocks && npm update;
16-
cd examples/masonry && npm update;
14+
$(foreach ex,$(EXAMPLES),(cd $(ex) && npm update) || exit $$?;)
1715
.PHONY: update
1816

1917
up:

0 commit comments

Comments
 (0)