Skip to content

Commit dbaa406

Browse files
committed
Allow collecting Lua filters into folder or tar archive
1 parent 5d133ca commit dbaa406

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Build artifacts in main and subdirs
2+
.build

Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
11
FILTERS=$(wildcard $(shell find * -type d | grep -v '[/\\]'))
2+
FILTER_FILES=$(shell find * -name "*.lua" -type f)
23
LUA_FILTERS_TEST_IMAGE = pandoc/lua-filters-test
34

4-
.PHONY: test docker-test docker-test-image
5+
.PHONY: test show-args docker-test docker-test-image archive
56

67
test:
78
bash runtests.sh $(FILTERS)
89

10+
archive: .build/lua-filters.tar.gz
11+
12+
show-vars:
13+
@printf "FILTERS: %s\n" $(FILTERS)
14+
@printf "FILTER_FILES: %s\n" $(FILTER_FILES)
15+
916
docker-test:
1017
docker run --rm --volume "$(PWD):/data" $(LUA_FILTERS_TEST_IMAGE) \
1118
make test
1219

1320
docker-test-image: .tools/Dockerfile
1421
docker build --tag $(LUA_FILTERS_TEST_IMAGE) --file $< .
22+
23+
# Build a single collection of Lua filters
24+
.PHONY: collection
25+
collection: .build/lua-filters
26+
27+
.build/lua-filters: $(FILTER_FILES)
28+
mkdir -p .build/lua-filters
29+
cp -a $(FILTER_FILES) .build/lua-filters
30+
cp -a LICENSE .build/lua-filters
31+
@printf "Filters collected in '%s'\n" "$@"
32+
33+
.build/lua-filters.tar.gz: .build/lua-filters
34+
tar -czf $@ -C .build lua-filters
35+
@printf "Archive written to '%s'\n" "$@"
36+
37+
clean:
38+
rm -rf .build
39+
$(foreach f,$(FILTERS),make -C $(f) clean;)

0 commit comments

Comments
 (0)