[BUGFIX] Fix CGL script to new return status strategy of php-cs-fixer 67/51567/2
authorWouter Wolters <typo3@wouterwolters.nl>
Mon, 6 Feb 2017 11:57:43 +0000 (12:57 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 7 Feb 2017 21:03:47 +0000 (22:03 +0100)
Status codes are only returned when running in dry-run mode.

Resolves: #79641
Releases: master,7.6
Change-Id: I3ca770d3f8c0af5aba5793cd4155722b8b68298c
Reviewed-on: https://review.typo3.org/51567
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Build/Scripts/cglFixMyCommit.sh

index 8e9533c..7aa80e5 100755 (executable)
 ##########################
 
 COUNTER=0
+DRYRUN=""
+
+if [ "$1" = "dryrun" ]
+then
+    DRYRUN="--dry-run"
+fi
 
 for FILE in $(git diff-tree --no-commit-id --name-only -r HEAD | grep '.php$'); do
     if [ -e $FILE ]
     then
         ./bin/php-cs-fixer fix $FILE \
-            -v \
+            -v $DRYRUN \
             --config=Build/.php_cs
-        if [ "$?" = "1" ]
+
+        if [ "$?" -gt "0" ]
         then
             COUNTER=$((COUNTER+1))
         fi