Skip to content

buildUpdateScript

buildUpdateScript(logPath, from?, to?): string

Defined in: src/herdr-update.ts:56

The shell program shepherd spawns as a managed child. Extracted + exported so its sequencing is unit-testable without a live herdr release.

Two guarantees:

  1. Every run appends ONE delimited block to logPath (default ~/.shepherd/herdr-update.log) via tee -a: a === herdr-update <UTC> <from> -> <to> === header, each step marker, raw herdr update output, and the exit code. The script writes this file itself so the record is COMPLETE even if shepherd crashes mid-update.

  2. Each step echoes a UPDATE_LOG_PREFIX marker BEFORE it runs, and the herdr update exit code is echoed explicitly.

Shepherd stays up during the update (no restart), so it captures this script’s stdout live for the modal. The tee -a keeps a durable post-mortem.

string

string | null

string | null

string