fix: herdr integrations make the hook directory herdr names
herdr writes its hook file but not the directory, so on a fresh box `herdr integration install omp` failed: omp had never created ~/.omp/agent/extensions. The step now reads the target path from `herdr integration status` and makes its directory, only for an agent that is present. The fake herdr fails like the real one when it is missing.
This commit is contained in:
1 parent
c710e1934d
commit
06b03c9528
3 files changed
+54
-11
No files matched your search
@@ -1219,11 +1219,18 @@ herdr_integrations() {
|
||||
hd=
|
||||
for ag in claude codex pi omp; do
|
||||
have "$ag" || continue
|
||||
case $(printf '%s\n' "$hst" | grep "^$ag: " || :) in
|
||||
hl=$(printf '%s\n' "$hst" | grep "^$ag: " || :)
|
||||
case $hl in
|
||||
*": current"*) continue ;;
|
||||
esac
|
||||
[ -n "$hd" ] || { head_ "herdr integrations"; hd=1; }
|
||||
run_sh "'$HERDR' integration install $ag" \
|
||||
# herdr writes the hook file but not its directory, and an agent that
|
||||
# has never run (omp on a fresh box) has no ~/.omp/agent/extensions
|
||||
# yet. The status line ends with the target path; make its directory.
|
||||
hdir=$(printf '%s\n' "$hl" | sed -n 's/^.*(\(\/.*\)\/[^/]*)$/\1/p')
|
||||
hmk=
|
||||
[ -n "$hdir" ] && [ ! -d "$hdir" ] && hmk="mkdir -p '$hdir' && "
|
||||
run_sh "$hmk'$HERDR' integration install $ag" \
|
||||
|| warn "herdr integration install $ag failed — agent state will not show in herdr"
|
||||
done
|
||||
}
|
||||
@@ -1366,6 +1373,14 @@ BWS_TOKEN=${DOTUP_BWS_TOKEN:-${XDG_CONFIG_HOME:-$HOME/.config}/bitwarden/bws-tok
|
||||
# are, days later, with nothing connecting it to the install you ran.
|
||||
PRIV_CFG=${DOTUP_PRIVATE_CFG:-${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/private.toml}
|
||||
|
||||
# ...and its own persistent state, for the same reason. chezmoi keeps the state
|
||||
# next to the config file, so both tiers shared chezmoistate.boltdb and each
|
||||
# overwrote the other's config-template hash: after the private init, every
|
||||
# public command warned "config file template has changed". The private
|
||||
# template names this file as persistentState too, but init opens the state
|
||||
# before it writes that config, so the flag is what makes the first init right.
|
||||
PRIV_STATE=$(dirname "$PRIV_CFG")/chezmoistate-private.boltdb
|
||||
|
||||
# git's credential store for the private remote.
|
||||
#
|
||||
# The clone URL the endpoint hands back carries the token inline, and handing
|
||||
@@ -1553,12 +1568,13 @@ cmd_private() {
|
||||
# transcript capturing the run.
|
||||
mkdir -p "$(dirname "$PRIV_CFG")"
|
||||
if [ "$DRYRUN" -eq 1 ]; then
|
||||
printf ' + chezmoi init --apply --source %s -c %s %s\n' \
|
||||
"$PRIV_SRC" "$PRIV_CFG" "$(redact_url "$p_clean")"
|
||||
printf ' + chezmoi init --apply --source %s -c %s --persistent-state %s %s\n' \
|
||||
"$PRIV_SRC" "$PRIV_CFG" "$PRIV_STATE" "$(redact_url "$p_clean")"
|
||||
else
|
||||
printf '%s + chezmoi init --apply --source %s -c %s %s%s\n' \
|
||||
"$DIM" "$PRIV_SRC" "$PRIV_CFG" "$(redact_url "$p_clean")" "$R" >&2
|
||||
"$CHEZMOI" init --apply --source "$PRIV_SRC" -c "$PRIV_CFG" "$p_clean" \
|
||||
printf '%s + chezmoi init --apply --source %s -c %s --persistent-state %s %s%s\n' \
|
||||
"$DIM" "$PRIV_SRC" "$PRIV_CFG" "$PRIV_STATE" "$(redact_url "$p_clean")" "$R" >&2
|
||||
"$CHEZMOI" init --apply --source "$PRIV_SRC" -c "$PRIV_CFG" \
|
||||
--persistent-state "$PRIV_STATE" "$p_clean" \
|
||||
|| err "private repo init failed"
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user