2016-01-08 22:46:06 -05:00
|
|
|
all: yadm.md contrib
|
2015-07-16 20:38:17 -04: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-08 22:46:06 -05:00
|
|
|
contrib:
|
|
|
|
@echo "CONTRIBUTORS\n" > CONTRIBUTORS
|
2017-01-12 18:11:30 -05:00
|
|
|
@git shortlog -ns master gh-pages dev dev-pages | cut -f2 >> CONTRIBUTORS
|
2016-01-08 22:46:06 -05:00
|
|
|
|
2015-07-16 20:38:17 -04:00
|
|
|
pdf:
|
|
|
|
@groff -man -Tps ./yadm.1 > yadm.ps
|
|
|
|
@open yadm.ps
|
|
|
|
@sleep 1
|
|
|
|
@rm yadm.ps
|
|
|
|
|
2016-03-23 20:18:33 -04:00
|
|
|
.PHONY: test
|
2016-04-07 09:16:13 -04:00
|
|
|
test: bats shellcheck
|
|
|
|
|
|
|
|
.PHONY: bats
|
|
|
|
bats:
|
|
|
|
@echo Running all bats tests
|
2016-06-08 09:33:05 -04:00
|
|
|
@GPG_AGENT_INFO= bats test
|
2016-03-23 20:18:33 -04:00
|
|
|
|
2016-04-07 09:16:13 -04:00
|
|
|
.PHONY: shellcheck
|
|
|
|
shellcheck:
|
|
|
|
@echo Running shellcheck
|
|
|
|
@shellcheck --version || true
|
|
|
|
@shellcheck -s bash yadm test/*.bash
|
2017-01-05 17:29:36 -05: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 09:16:13 -04:00
|
|
|
test_result="$$?"; \
|
2017-01-05 17:29:36 -05:00
|
|
|
rm -f "/tmp/$$bats_file.bash"; \
|
2016-04-07 09:16:13 -04:00
|
|
|
[ "$$test_result" -ne 0 ] && exit 1; \
|
|
|
|
done; true
|
|
|
|
|
2015-07-16 20:38:17 -04:00
|
|
|
man:
|
|
|
|
groff -man -Tascii ./yadm.1 | less
|
|
|
|
|
|
|
|
wide:
|
|
|
|
man ./yadm.1
|