1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2024-10-27 20:34:27 +00:00
TheLocehiliosan_yadm/Makefile

47 lines
1.0 KiB
Makefile
Raw Normal View History

2016-01-09 03:46:06 +00:00
all: yadm.md contrib
yadm.md: yadm.1
@groff -man -Tascii ./yadm.1 | col -bx | sed 's/^[A-Z]/## &/g' | sed '/yadm(1)/d' > yadm.md
2016-01-09 03:46:06 +00:00
contrib:
@echo "CONTRIBUTORS\n" > CONTRIBUTORS
@git shortlog -ns master gh-pages dev dev-pages | cut -f2 >> CONTRIBUTORS
2016-01-09 03:46:06 +00:00
pdf:
@groff -man -Tps ./yadm.1 > yadm.ps
@open yadm.ps
@sleep 1
@rm yadm.ps
.PHONY: test
2016-04-07 13:16:13 +00:00
test: bats shellcheck
2017-01-16 23:01:53 +00:00
.PHONY: parallel
parallel:
ls test/*bats | time parallel -q -P0 -- docker run --rm -v "$$PWD:/yadm:ro" yadm/testbed bash -c 'bats {}'
2016-04-07 13:16:13 +00:00
.PHONY: bats
bats:
@echo Running all bats tests
@GPG_AGENT_INFO= bats test
2016-04-07 13:16:13 +00:00
.PHONY: shellcheck
shellcheck:
@echo Running shellcheck
@shellcheck --version || true
@shellcheck -s bash yadm test/*.bash
2017-01-05 22:29:36 +00:00
@cd test; \
for bats_file in *bats; do \
sed 's/^@test.*{/function test() {/' "$$bats_file" > "/tmp/$$bats_file.bash"; \
shellcheck -s bash "/tmp/$$bats_file.bash"; \
2016-04-07 13:16:13 +00:00
test_result="$$?"; \
2017-01-05 22:29:36 +00:00
rm -f "/tmp/$$bats_file.bash"; \
2016-04-07 13:16:13 +00:00
[ "$$test_result" -ne 0 ] && exit 1; \
done; true
man:
groff -man -Tascii ./yadm.1 | less
wide:
man ./yadm.1