Skip to content

Commit 436df85

Browse files
engalarclaude
andcommitted
build: add install-daemon Makefile target for local dev workflow
After make build, run `make install-daemon` to replace the downloaded release daemon with the locally-built binary. This ensures mxcli uses current dev-branch code (including unfixed regressions or new features) during local development and golden rebuilds, rather than the latest release from GitHub. The target stops any running daemon process before copying, then reports the installed version for verification. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 73f5322 commit 436df85

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,26 @@ TEST_PARALLEL ?= $(_85PCT)
5151
# Hard ceiling on how long the full test suite may run.
5252
TEST_TIMEOUT ?= 180s
5353

54-
.PHONY: build build-debug release clean test _test-inner test-mdl report report-bench report-reset-baseline bench-baseline grammar sync-skills sync-commands sync-lint-rules sync-changelog sync-examples sync-all docs documentation docs-site docs-serve source-tree sbom sbom-report lint lint-go fmt vet update-helpdesk-golden test-helpdesk-regression setup
54+
.PHONY: build build-debug release clean test _test-inner test-mdl report report-bench report-reset-baseline bench-baseline grammar sync-skills sync-commands sync-lint-rules sync-changelog sync-examples sync-all docs documentation docs-site docs-serve source-tree sbom sbom-report lint lint-go fmt vet update-helpdesk-golden test-helpdesk-regression setup install-daemon
5555

5656
setup:
5757
git config core.hooksPath .githooks
5858
@echo "Git hooks configured. Pre-commit unit tests enabled."
5959

60+
# Install the locally-built daemon over the downloaded release binary.
61+
# Ensures mxcli uses the current dev-branch code during local development.
62+
# Windows: stop running daemon first (taskkill may fail if already stopped).
63+
install-daemon: build
64+
@DAEMON_DIR="$$HOME/.mxcli/daemon"; \
65+
DAEMON_BIN="$$DAEMON_DIR/mxcli-daemon$(if $(findstring windows,$(shell go env GOOS)),.exe,)"; \
66+
if [ -f "$$DAEMON_BIN" ]; then \
67+
echo "Stopping running daemon..."; \
68+
pkill -f mxcli-daemon 2>/dev/null || powershell.exe -Command "Stop-Process -Name mxcli-daemon -Force -ErrorAction SilentlyContinue" 2>/dev/null || true; \
69+
sleep 1; \
70+
fi; \
71+
cp "$(BUILD_DIR)/$(DAEMON_NAME)$(if $(findstring windows,$(shell go env GOOS)),.exe,)" "$$DAEMON_BIN"; \
72+
echo "Installed: $$DAEMON_BIN ($$("$$DAEMON_BIN" --version 2>&1 | head -1))"
73+
6074
# Helper: copy file only if content differs (avoids mtime updates that invalidate go build cache)
6175
# Usage: $(call copy-if-changed,src,dst)
6276
define copy-if-changed

0 commit comments

Comments
 (0)