make: style(-fix) hangs when directory is not there

This commit is contained in:
Franco Fichtner 2016-11-12 08:23:13 +01:00
parent 6bc1ba46ac
commit 4888ae9d72
2 changed files with 10 additions and 4 deletions

View file

@ -20,7 +20,7 @@ list-full:
@echo ${PLUGIN_DIR} -- $$(${MAKE} -C ${PLUGIN_DIR} -V PLUGIN_COMMENT)
.endfor
TARGETS= lint sweep sytle style-fix clean
TARGETS= lint sweep style style-fix clean
.for TARGET in ${TARGETS}
${TARGET}:

View file

@ -214,8 +214,11 @@ sweep: check
xargs -0 -n1 ${.CURDIR}/../../Scripts/cleanfile
style: check
@(phpcs --standard=${.CURDIR}/../../ruleset.xml ${.CURDIR}/src \
|| true) > ${.CURDIR}/.style.out
@: > ${.CURDIR}/.style.out
@if [ -d ${.CURDIR}/src ]; then \
(phpcs --standard=${.CURDIR}/../../ruleset.xml \
${.CURDIR}/src || true) > ${.CURDIR}/.style.out; \
fi
@echo -n "Total number of style warnings: "
@grep '| WARNING' ${.CURDIR}/.style.out | wc -l
@echo -n "Total number of style errors: "
@ -224,6 +227,9 @@ style: check
@rm ${.CURDIR}/.style.out
style-fix: check
phpcbf --standard=${.CURDIR}/../../ruleset.xml ${.CURDIR}/src || true
@if [ -d ${.CURDIR}/src ]; then \
phpcbf --standard=${.CURDIR}/../../ruleset.xml \
${.CURDIR}/src || true; \
fi
.PHONY: check