Fixes pre-commit failing on build step (#10785)

When rebuildig the image during commit, kill command failed to
find the spinner job to kill (this is just preventive measure)
and failed the rebuild step in pre-commit.

This is now fixed.
This commit is contained in:
Jarek Potiuk 2020-09-07 22:38:39 +02:00 коммит произвёл GitHub
Родитель f14f379716
Коммит ef0d639b34
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -509,7 +509,7 @@ function build_images::build_ci_image() {
spinner::spin "${OUTPUT_LOG}" &
SPIN_PID=$!
# shellcheck disable=SC2064
traps::add_trap "kill ${SPIN_PID}" INT TERM HUP EXIT
traps::add_trap "kill ${SPIN_PID} || true" INT TERM HUP EXIT
fi
push_pull_remove_images::pull_ci_images_if_needed
if [[ "${DOCKER_CACHE}" == "disabled" ]]; then
@ -537,7 +537,7 @@ function build_images::build_ci_image() {
spinner::spin "${OUTPUT_LOG}" &
SPIN_PID=$!
# shellcheck disable=SC2064
traps::add_trap "kill ${SPIN_PID}" EXIT HUP INT TERM
traps::add_trap "kill ${SPIN_PID} || true" EXIT HUP INT TERM
fi
if [[ -n ${DETECTED_TERMINAL=} ]]; then
echo -n "

Просмотреть файл

@ -235,7 +235,7 @@ EOF
}
function stop_output_heartbeat() {
kill "${HEARTBEAT_PID}"
kill "${HEARTBEAT_PID}" || true
wait "${HEARTBEAT_PID}" || true 2> /dev/null
}