99
1010# Check if the current Git command is a rebase
1111if test " $GIT_COMMAND " = " rebase" ; then
12- npx --yes chalk-cli --no-stdin -t " {green ✔} Skip pre-commit hook during rebase"
12+ zz_log s " Skip pre-commit hook during rebase"
1313 exit 0
1414fi
1515
@@ -19,7 +19,7 @@ echo $GIT_COMMAND
1919if git diff ${@:- --cached --name-only} | grep -q " package.json" ; then
2020
2121 # ensure that the package.json is valid and package-lock.json is up-to-date
22- npx --yes chalk-cli --no-stdin -t " {blue →} Ensure that the package.json is valid and package-lock.json is up-to-date..."
22+ zz_log i " Ensure that the package.json is valid and package-lock.json is up-to-date..."
2323
2424 ws=$( npm pkg get workspaces)
2525 if test " $ws " = " undefined" || test " $ws " = " {}" ; then
@@ -30,17 +30,17 @@ if git diff ${@:---cached --name-only} | grep -q "package.json"; then
3030
3131 # commit the updated package-lock.json if file changed
3232 if git diff --quiet package-lock.json; then
33- npx --yes chalk-cli --no-stdin -t " {green ✔} package-lock.json update not required"
33+ zz_log s " package-lock.json update not required"
3434 else
35- git add package-lock.json && npx --yes chalk-cli --no-stdin -t " {yellow ⚠} Updated package-lock.json"
35+ git add package-lock.json && zz_log w " Updated package-lock.json"
3636 fi
3737fi
3838
3939# Check if the current commit contains composer.json changes
4040if git diff ${@:- --cached --name-only} | grep -q " composer.json" ; then
4141
4242 # ensure that the composer.json is valid and composer.lock is up-to-date
43- npx --yes chalk-cli --no-stdin -t " {blue →} Ensure that the composer.json is valid and composer.lock is up-to-date..."
43+ zz_log i " Ensure that the composer.json is valid and composer.lock is up-to-date..."
4444 composer validate --no-check-all --strict 2>&1 | grep -oP ' Required package "\K[^"]+' | while read -r package; do
4545 composer require --ignore-platform-reqs --with-all-dependencies --no-scripts --no-interaction --no-progress --no-install " $package "
4646 done
@@ -50,9 +50,9 @@ if git diff ${@:---cached --name-only} | grep -q "composer.json"; then
5050
5151 # commit the updated composer.lock if file changed
5252 if git diff --quiet composer.lock; then
53- npx --yes chalk-cli --no-stdin -t " {green ✔} composer.lock update not required"
53+ zz_log s " composer.lock update not required"
5454 else
55- git add composer.lock && npx --yes chalk-cli --no-stdin -t " {yellow ⚠} Updated composer.lock"
55+ git add composer.lock && zz_log w " Updated composer.lock"
5656 fi
5757fi
5858
0 commit comments