Fix calling commands individually

This commit is contained in:
Arnie 2017-12-25 09:42:09 +01:00
parent 3fea4a6c78
commit f6640a44e2
4 changed files with 8 additions and 7 deletions

View File

@ -5,9 +5,9 @@ __csscomb() {
__msg "Csscomb:"
if [[ ${DRY_RUN} -eq 0 ]]; then
csscomb -v "$@"
csscomb -v "${CSS_FILES[@]}"
else
csscomb --lint -v "$@"
csscomb --lint -v "${CSS_FILES[@]}"
fi
return $?

View File

@ -10,6 +10,7 @@ __phpFixer() {
if [[ ${DRY_RUN} -eq 0 ]]; then
for file in "${PHP_FILES[@]}"; do
php-cs-fixer fix "${file}"
[[ $? -ne 0 ]] && failed=1
done
else
local needs_fixing=()

View File

@ -5,10 +5,10 @@ __prettier() {
__msg "Prettier:"
if [[ ${DRY_RUN} -eq 0 ]]; then
prettier --write "$@"
prettier --write "${JS_FILES[@]}"
else
__msg "Listing (: unprettiered :) files:" 1
prettier --list-different "$@"
prettier --list-different "${JS_FILES[@]}"
fi
return $?

View File

@ -11,19 +11,19 @@ process() {
# Run css comb
if [[ ${#CSS_FILES[@]} -ne 0 ]]; then
__csscomb "${CSS_FILES[@]}"
__csscomb
[[ $? -ne 0 ]] && failed=1
fi
# Run JS prettier
if [[ ${#JS_FILES[@]} -ne 0 ]]; then
__prettier "${JS_FILES[@]}"
__prettier
[[ $? -ne 0 ]] && failed=1
fi
# Run PHP cs fixer
if [[ ${#PHP_FILES[@]} -ne 0 ]]; then
__phpFixer ${PHP_FILES[@]}
__phpFixer
[[ $? -ne 0 ]] && failed=1
fi