Write .bash version of .bats to /tmp
This commit is contained in:
parent
c4f2141e35
commit
06757b3544
1 changed files with 5 additions and 4 deletions
9
Makefile
9
Makefile
|
@ -26,11 +26,12 @@ 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"; \
|
||||
@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"; \
|
||||
test_result="$$?"; \
|
||||
rm -f "$$bats_file .bash"; \
|
||||
rm -f "/tmp/$$bats_file.bash"; \
|
||||
[ "$$test_result" -ne 0 ] && exit 1; \
|
||||
done; true
|
||||
|
||||
|
|
Loading…
Reference in a new issue