Skip to content

Commit 7263322

Browse files
committed
Update Makefile
1 parent 694a929 commit 7263322

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: test phpcs test-report test-fix update-compatibility-patch
22

3-
PHP_74_OR_NEWER=`php -r "echo (int) version_compare(PHP_VERSION, '7.4', '>=');"`
3+
PHP_74_OR_NEWER:=$(shell php -r "echo (int) version_compare(PHP_VERSION, '7.4', '>=');")
44

55
test: test-report test-fix
66

@@ -11,7 +11,7 @@ phpcs:
1111

1212
test-report: vendor
1313
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply tests/php-compatibility.patch; fi
14-
@vendor/bin/phpcs `find tests/input/* | sort` --report=summary --report-file=phpcs.log; diff tests/expected_report.txt phpcs.log; if [ $$? -ne 0 ] && [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; exit 1; fi
14+
@vendor/bin/phpcs `find tests/input/* | sort` --report=summary --report-file=phpcs.log; diff -u tests/expected_report.txt phpcs.log; if [ $$? -ne 0 ]; then if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; fi; exit 1; fi
1515
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; fi
1616

1717
test-fix: vendor
@@ -22,10 +22,11 @@ test-fix: vendor
2222

2323
update-compatibility-patch:
2424
@git apply tests/php-compatibility.patch
25-
@echo -e "Please open your editor and apply your changes\n"
25+
@printf "Please open your editor and apply your changes\n"
2626
@until [ "$${compatibility_resolved}" == "y" ]; do read -p "Have finished your changes (y|n)? " compatibility_resolved; done && compatibility_resolved=
2727
@git diff -- tests/expected_report.txt tests/fixed > .tmp-patch && mv .tmp-patch tests/php-compatibility.patch && git apply -R tests/php-compatibility.patch
2828
@git commit -m 'Update compatibility patch' tests/php-compatibility.patch
2929

3030
vendor: composer.json
3131
composer update
32+
touch -c vendor

0 commit comments

Comments
 (0)