#!/usr/bin/env bash
echo "Running php-cs-fixer to format the code..."
# Variables
# shellcheck disable=SC2164
CURRENT_DIRECTORY="$(cd "$(dirname "$0")"; pwd -P)"
PROJECT_DIRECTORY="$(dirname "${CURRENT_DIRECTORY}")"
# shellcheck disable=SC2164
cd "${PROJECT_DIRECTORY}";
PHP_CS_FIXER="${PROJECT_DIRECTORY}/vendor/bin/php-cs-fixer"
PHP_CS_CONFIG=".php-cs-fixer.php"
# PHP CS Fixer
php "${CURRENT_DIRECTORY}/run" ${PHP_CS_FIXER} fix --config=${PHP_CS_CONFIG} --verbose;
git add "${PROJECT_DIRECTORY}"
# shellcheck disable=SC2164
cd "${CURRENT_DIRECTORY}";
echo "[Done] Operation completed!"
|