Allow hooks to run all checks before terminating

Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Christian Wolf 2021-11-25 12:10:47 +01:00
Родитель 9574643cb5
Коммит f815294a1f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9FC3120E932F73F1
2 изменённых файлов: 18 добавлений и 6 удалений

Просмотреть файл

@ -14,6 +14,14 @@ cleanup() {
trap cleanup EXIT
if [ -e 'node_modules/.bin/eslint' ]; then
npm run --silent eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; exit 1; }
retVal=0
if [ -e 'vendor/bin/php-cs-fixer' ]; then
composer cs:check || { echo "The PHP code is not validly formatted."; (( retVal |= 1 )); }
fi
if [ -e 'node_modules/.bin/eslint' ]; then
npm run --silent eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; (( retVal |= 2 )); }
fi
exit $retVal

Просмотреть файл

@ -14,20 +14,24 @@ cleanup() {
trap cleanup EXIT
retVal=0
if [ -e 'vendor/bin/php-cs-fixer' ]; then
composer cs:check || { echo "The PHP code is not validly formatted."; exit 1; }
composer cs:check || { echo "The PHP code is not validly formatted."; (( retVal |= 1 )); }
fi
if [ -e 'node_modules/.bin/eslint' ]; then
npm run eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; exit 2; }
npm run eslint || { echo 'The javascript code seems to be not satifying the eslint linter.'; (( retVal |= 2 )); }
fi
if [ -e 'node_modules/.bin/prettier' ]; then
npm run prettier || { echo 'The javascript code seems to be not satifying the prettier code styler.'; exit 3; }
npm run prettier || { echo 'The javascript code seems to be not satifying the prettier code styler.'; (( retVal |= 4 )); }
fi
if [ -e 'node_modules/.bin/stylelint' ]; then
npm run stylelint || { echo 'The CSS code seems to be not satifying the stylelint linter.'; exit 4; }
npm run stylelint || { echo 'The CSS code seems to be not satifying the stylelint linter.'; (( retVal |= 8 )); }
fi
exit $retVal