mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-18 06:10:23 +00:00
Fix the local hot-dev backend monitor so a missing Pulse process is counted safely under pipefail, keep backend launch stderr in the debug log, and govern the new runtime helper with focused smoke coverage.
21 lines
470 B
Bash
21 lines
470 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Shared helpers for the managed local Pulse development runtime.
|
|
|
|
hot_dev_pulse_process_count() {
|
|
local pattern="${1:-^\./pulse$}"
|
|
local count=0
|
|
local pid
|
|
|
|
if ! command -v pgrep >/dev/null 2>&1; then
|
|
printf '0\n'
|
|
return 0
|
|
fi
|
|
|
|
while IFS= read -r pid; do
|
|
[[ -n "${pid}" ]] || continue
|
|
count=$((count + 1))
|
|
done < <(pgrep -f "${pattern}" 2>/dev/null || true)
|
|
|
|
printf '%s\n' "${count}"
|
|
}
|