Description
Description
Hi, I've configured cz to run some custom pre-commit scripts, and these scripts work as expected if directly called via .git/hooks/pre-commit or via "git commit -m ..."
if i use instead cz, after its questions and my answers, it produces its "purple" commit message, then the SAME hooks scripts start running but i can't see any output until the script as fully completed its run...
as some tasks in these scripts are very long to run, i'd like to have some output given to the user on what's going on in the background...
thanks in advance
Steps to reproduce
- .git/hooks/pre-commit #. works and produces its own output
- git commit -m "something" #. works and produces its own output
- cz c (and following Q&A) # waits for script completion before producing output
Current behavior
this fully works if called manually or via git commit, producing the desired output, while does not until fully completed in case of using "cz c"
#!/usr/bin/env bash
source "${HOME}/.aliases.sh"
function main() {
if [ -n "${REMOTE_CONTAINERS}" ]; then
printf "${COLOR_GREEN}%s${COLOR_NONE}\n" "Updating Helm dependencies... Please be patient..."
if ! updateCharts
then
printf '\n%s\n' "${COLOR_RED}----------------------------${COLOR_NONE}"
printf '%s\n' "${COLOR_RED}!!! Cannot update charts !!!${COLOR_NONE}"
printf '%s\n' "${COLOR_RED}----------------------------${COLOR_NONE}"
exit 1
else
git add "${WORKSPACE}/infrastructure/helm/Chart.lock"
git add "${WORKSPACE}/infrastructure/helm/charts"
fi
if ! testTemplates
then
exit 1
fi
fi
}
function testTemplates() {
result=true
for f in "${WORKSPACE}/infrastructure/helm/values/"*
do
if [ ! -d "${f}" ];
then
filename=$(basename -- "${f}")
env="${filename%.*}"
if ! template -n "precommit" "${env}"
then
result=false
printf '\n%s\n' "${COLOR_RED}----------------------------------------------${COLOR_NONE}"
printf '%s\n' "${COLOR_RED}!!! Templating of ${env} environment failed !!!${COLOR_NONE}"
printf '%s\n' "${COLOR_RED}----------------------------------------------${COLOR_NONE}"
fi
fi
done
rm -rf "${WORKSPACE}/template/"*"precommit"*
$result
}
main
Desired behavior
having my output on console while scripts run, so users are aware of what's going on
Screenshots
No response
Environment
Commitizen Version: 4.1.0
Python Version: 3.13.1 (main, Jan 7 2025, 11:12:45) [GCC 12.2.0]
Operating System: Linux
Activity