mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-07-13 11:35:17 +03:00
fix(install): never rm -rf a shared Hermes plugins directory (#676)
install_hermes() resolved `dest` from HERMES_PLUGIN_DIR and ran `rm -rf "$dest"`. The var name invites setting it to the plugins *parent* (~/.hermes/plugins) rather than the full plugin path, in which case the rm -rf wiped the entire plugins directory and every other plugin in it. Always target the agency-agents-router subdir (append it when the resolved path doesn't already end in it), and add a defensive guard that refuses to remove any path whose basename isn't `agency-agents-router`. Verified: with HERMES_PLUGIN_DIR set to the plugins parent, a sibling plugin's data now survives the install. Fixes #669 Claude-Session: https://claude.ai/code/session_01WKnDRWM4izsB8WAXKszhsq Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
6f8d5e50ea
commit
ef1352f84b
@@ -1069,11 +1069,23 @@ install_hermes() {
|
||||
local src="$INTEGRATIONS/hermes/agency-agents-router"
|
||||
local hermes_home; hermes_home="$(hermes_home_dir)"
|
||||
local dest; dest="$(resolve_dest hermes "${hermes_home}/plugins/agency-agents-router")"
|
||||
# HERMES_PLUGIN_DIR is ambiguous: its name invites setting it to the plugins
|
||||
# parent (~/.hermes/plugins) rather than the full plugin path. Always target
|
||||
# the agency-agents-router subdir so we never rm -rf a shared plugins dir that
|
||||
# holds other plugins.
|
||||
if [[ "$(basename "$dest")" != "agency-agents-router" ]]; then
|
||||
dest="${dest%/}/agency-agents-router"
|
||||
fi
|
||||
[[ -f "$src/plugin.yaml" && -f "$src/__init__.py" && -f "$src/data/agents.json" ]] || {
|
||||
err "integrations/hermes/agency-agents-router missing. Run ./scripts/convert.sh --tool hermes first."
|
||||
return 1
|
||||
}
|
||||
mkdir -p "$(dirname "$dest")"
|
||||
# Safety net: only ever remove our own plugin directory, never a parent.
|
||||
if [[ "$(basename "$dest")" != "agency-agents-router" ]]; then
|
||||
err "Hermes: refusing to remove '$dest' — expected an agency-agents-router directory."
|
||||
return 1
|
||||
fi
|
||||
rm -rf "$dest"
|
||||
if $USE_LINK; then
|
||||
ln -s "$src" "$dest"
|
||||
|
||||
Reference in New Issue
Block a user