Он компилирует файлы и игнорирует все ошибки. Теперь я хочу, чтобы он завершал компиляцию, если ошибка существует
Примечание: я работаю с докером-контейнером. Этот код выполняется после.yml файл. yml выходит из компилятора, если есть ошибка, но в этом файле он игнорирует все ошибки
Вот мой shell-scripts-dev.sh
файл
#!/bin/bash
#do not enter current dir
#cd $(dirname $0)
BASEDIR=$(dirname "$0")
printf "\n"
printf "###############################################################################\n"
printf "# Running dev script from directory #\n"
printf "###############################################################################\n"
pwd
printf "\n"
printf "###############################################################################\n"
printf "# Create initial/ needed files #\n"
printf "###############################################################################\n"
# backend init files
if [ ! -f backend/config/main-local.php ]; then
printf "File backend/config/main-local.php does not exist, creating it, please edit configuration on server!\n"
cp backend/config/main-local.example backend/config/main-local.php
fi
if [ ! -f backend/config/params.php ]; then
printf "File backend/config/params.php does not exist, creating it, please edit configuration on server!\n"
cp backend/config/params.example backend/config/params.php
fi
if [ ! -f backend/web/index.php ]; then
printf "File backend/web/index.php does not exist, creating it, please edit configuration on server!\n"
cp backend/web/index.example backend/web/index.php
fi
if [ ! -f backend/web/index-test.php ]; then
printf "File backend/web/index-test.php does not exist, creating it, please edit configuration on server!\n"
cp backend/web/index.example backend/web/index-test.php
fi
# common init files
if [ ! -f common/config/main.php ]; then
printf "File common/config/main.php does not exist, creating it, please edit configuration on server!\n"
cp common/config/main.example common/config/main.php
fi
if [ ! -f common/config/main-local.php ]; then
printf "File common/config/main-local.php does not exist, creating it, please edit configuration on server!\n"
cp common/config/main-local.example common/config/main-local.php
fi
if [ ! -f common/config/params.php ]; then
printf "File common/config/params.php does not exist, creating it, please edit configuration on server!\n"
cp common/config/params.example common/config/params.php
fi
# rest init files
if [ ! -f rest/config/params.php ]; then
printf "File rest/config/params.php does not exist, creating it, please edit configuration on server!\n"
cp rest/config/params.example rest/config/params.php
fi
if [ ! -f rest/web/index.php ]; then
printf "File rest/web/index.php does not exist, creating it, please edit configuration on server!\n"
cp rest/web/index.example rest/web/index.php
fi
if [ ! -f rest/web/index-test.php ]; then
printf "File rest/web/index-test.php does not exist, creating it, please edit configuration on server!\n"
cp rest/web/index.example rest/web/index-test.php
fi
printf "\n"
printf "###############################################################################\n"
printf "# Clearing cache #\n"
printf "###############################################################################\n"
# backend runtime files
rm -rf backend/web/assets/*
rm -rf backend/runtime/debug/*
rm -rf backend/runtime/logs/*
rm -rf backend/runtime/mail/*
rm -rf backend/runtime/URI/*
rm -rf cache/*
# rest runtime files
rm -rf rest/runtime/cache/*
rm -rf backend/runtime/debug/*
rm -rf backend/runtime/logs/*
rm -rf backend/runtime/mail/*
###############################################################################
# Rebuild assets# - don't we need this???
###############################################################################
#chmod +x ../app/Console/cake
#cd ../app && Vendor/bin/cake asset_compress build --force
printf "\n"
printf "###############################################################################\n"
printf "# Composer update #\n"
printf "###############################################################################\n"
php composer.phar install
printf "\n"
printf "###############################################################################\n"
printf "# Running yii migrations #\n"
printf "###############################################################################\n"
yes | php yii migrate
printf "\n"
printf "###############################################################################\n"
printf "#Run PhpSniffer and output any errors #\n"
printf "###############################################################################\n"
php ./vendor/bin/phpcs --encoding=utf-8 --extensions=php backend --colors
php ./vendor/bin/phpcs --encoding=utf-8 --extensions=php common --colors
php
./vendor/bin/phpcs --encoding=utf-8 --extensions=php rest --colors