2016-01-09 03:46:06 +00:00
|
|
|
all: yadm.md contrib
|
2015-07-17 00:38:17 +00:00
|
|
|
|
|
|
|
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 | cut -f2 >> CONTRIBUTORS
|
|
|
|
|
2015-07-17 00:38:17 +00:00
|
|
|
pdf:
|
|
|
|
@groff -man -Tps ./yadm.1 > yadm.ps
|
|
|
|
@open yadm.ps
|
|
|
|
@sleep 1
|
|
|
|
@rm yadm.ps
|
|
|
|
|
2016-03-24 00:18:33 +00:00
|
|
|
.PHONY: test
|
2016-04-07 13:16:13 +00:00
|
|
|
test: bats shellcheck
|
|
|
|
|
|
|
|
.PHONY: bats
|
|
|
|
bats:
|
|
|
|
@echo Running all bats tests
|
2016-03-24 00:18:33 +00:00
|
|
|
@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
|
|
|
|
@for bats_file in test/*bats; do \
|
|
|
|
sed 's/^@test.*{/function test() {/' "$$bats_file" > "$$bats_file .bash"; \
|
|
|
|
shellcheck -s bash "$$bats_file .bash"; \
|
|
|
|
test_result="$$?"; \
|
|
|
|
rm -f "$$bats_file .bash"; \
|
|
|
|
[ "$$test_result" -ne 0 ] && exit 1; \
|
|
|
|
done; true
|
|
|
|
|
2015-07-17 00:38:17 +00:00
|
|
|
man:
|
|
|
|
groff -man -Tascii ./yadm.1 | less
|
|
|
|
|
|
|
|
wide:
|
|
|
|
man ./yadm.1
|