Skip to content

Commit 4110b53

Browse files
committed
Review fixes
1 parent 4b596b6 commit 4110b53

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

.githooks/pre-commit

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,10 @@ lint_code() {
163163
scripts/evergreen/lint_code.sh
164164
}
165165

166-
# bg_job_ vars are global; capture_bg_job function is appending to them on each call
166+
# bg_job_ vars are global; run_job_in_background function is appending to them on each call
167167
bg_job_pids=()
168168
bg_job_pids_with_names=()
169169

170-
# Helper function to capture background job PID with job name
171-
capture_bg_job() {
172-
local job_name="$1"
173-
local job_pid=$!
174-
bg_job_pids+=("${job_pid}")
175-
bg_job_pids_with_names+=("${job_pid}:${job_name}")
176-
echo "Started ${job_name} with PID: ${job_pid}"
177-
}
178-
179170
get_job_name() {
180171
local search_pid="$1"
181172
local match
@@ -189,7 +180,11 @@ get_job_name() {
189180
run_job_in_background() {
190181
job_name=$1
191182
time ${job_name} 2>&1 | prepend "${job_name}" &
192-
capture_bg_job "${job_name}"
183+
184+
local job_pid=$!
185+
bg_job_pids+=("${job_pid}")
186+
bg_job_pids_with_names+=("${job_pid}:${job_name}")
187+
echo "Started ${job_name} with PID: ${job_pid}"
193188
}
194189

195190
# Waits for all background jobs stored in bg_job_pids and check their exit codes.

0 commit comments

Comments
 (0)