Skip to content

Commit ad0900a

Browse files
Merge pull request #84 from edmondscommerce/1.2-fix-md-issues
Get md to fail when it has a fatal error for version 1.2
2 parents ce7179d + c6d42b8 commit ad0900a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

includes/generic/messDetector.inc.bash

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ phpMdExitCode=99
66
while (( phpMdExitCode > 0 ))
77
do
88
set -x
9-
phpNoXdebug -f bin/phpmd -- \
9+
output=$(phpNoXdebug -f bin/phpmd -- \
1010
$pathsString \
1111
text \
1212
"$phpmdConfigPath" \
1313
--suffixes php,phtml \
14-
--exclude $ignoreString \
15-
| sort -u \
16-
| sed G \
17-
| sed -e 's#p:#p\nLine: #' \
18-
| sed -e 's#\t\{1,\}#\nMessage: #' \
19-
| sed -e 's#\. #\.\n#'
20-
phpMdExitCode=$?
14+
--exclude $ignoreString)
15+
if [[ "$output" == "" ]]
16+
then
17+
phpMdExitCode=0;
18+
else
19+
echo "$output" \
20+
| sort -u \
21+
| sed G \
22+
| sed -e 's#p:#p\nLine: #' \
23+
| sed -e 's#\t\{1,\}#\nMessage: #' \
24+
| sed -e 's#\. #\.\n#'
25+
phpMdExitCode=1
26+
fi
2127
set +x
2228
if (( phpMdExitCode > 0 ))
2329
then

0 commit comments

Comments
 (0)