Refuse make install from GHA runner worktrees.

Keep host ~/.local/bin myagents links from pointing at ephemeral _work checkouts.
This commit is contained in:
Zhengshou Lai
2026-08-11 22:16:56 +08:00
parent 3d40e27a93
commit c2d8e1c014
+12
View File
@@ -11,7 +11,15 @@ help:
@echo " install Sync venv, symlink bin, install shell completions"
@echo " uninstall Remove bin, completions and user symlinks"
# Working tree: xiaohe-agent/packages/myagents (submodule of apaam/myagents).
# Refuse ephemeral GHA runner checkouts (_work) so ~/.local/bin cannot point there.
install:
@case "$(ROOT_DIR)" in \
*/_work/*|*/.xiaohe/actions-runner/*) \
echo "ERROR: refuse install from GHA runner worktree: $(ROOT_DIR)" >&2; \
echo "Use: cd <xiaohe-agent>/packages/myagents && make install" >&2; \
exit 1 ;; \
esac
@cd "$(ROOT_DIR)" && \
if command -v uv >/dev/null 2>&1; then \
uv sync; \
@@ -22,6 +30,10 @@ install:
@$(MAKE) _symlink-commands
@echo "Installing shell completions…"
@myagents completion install || echo "Warning: completion install failed"
@case "$(ROOT_DIR)" in \
*/_work/*|*/.xiaohe/actions-runner/*) \
echo "ERROR: install root still a runner tree: $(ROOT_DIR)" >&2; exit 1 ;; \
esac
_symlink-commands:
@mkdir -p "$(USER_BIN_DIR)"