From 4888ae9d723aedb79732148cdf2b55ce891571b3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sat, 12 Nov 2016 08:23:13 +0100 Subject: [PATCH] make: style(-fix) hangs when directory is not there --- Makefile | 2 +- Mk/plugins.mk | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8817a2c57..3e6f48cf3 100644 --- a/Makefile +++ b/Makefile @@ -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}: diff --git a/Mk/plugins.mk b/Mk/plugins.mk index a37c2cb2e..becb616a8 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -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