-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.71 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
INSTALL_DIR ?= $(HOME)/.local/bin
CLAUDE_SETTINGS := $(HOME)/.claude/settings.json
.PHONY: build build-release test install install-service setup-claude fmt lint lint-ci install-hooks clean
build:
cargo build
build-release:
cargo build --release
test:
cargo test
install: build-release
@mkdir -p $(INSTALL_DIR)
cp target/release/canopy $(INSTALL_DIR)/canopy
cp target/release/canopy-mcp $(INSTALL_DIR)/canopy-mcp
@echo "Installed canopy + canopy-mcp to $(INSTALL_DIR)"
install-service: build-release
@mkdir -p $(INSTALL_DIR)
cp target/release/canopy-service $(INSTALL_DIR)/canopy-service
@echo "Installed canopy-service to $(INSTALL_DIR)"
setup-claude:
@mkdir -p $(HOME)/.claude
@if [ -f "$(CLAUDE_SETTINGS)" ] && grep -q '"canopy"' "$(CLAUDE_SETTINGS)" 2>/dev/null; then \
echo "canopy MCP server already configured in $(CLAUDE_SETTINGS)"; \
elif [ -f "$(CLAUDE_SETTINGS)" ] && grep -q '"mcpServers"' "$(CLAUDE_SETTINGS)" 2>/dev/null; then \
if [ "$$(uname -s)" = "Darwin" ]; then \
sed -i '' 's/"mcpServers" *: *{/"mcpServers": { "canopy": { "command": "canopy-mcp" },/' "$(CLAUDE_SETTINGS)"; \
else \
sed -i 's/"mcpServers" *: *{/"mcpServers": { "canopy": { "command": "canopy-mcp" },/' "$(CLAUDE_SETTINGS)"; \
fi; \
echo "Added canopy to existing $(CLAUDE_SETTINGS)"; \
else \
echo '{ "mcpServers": { "canopy": { "command": "canopy-mcp" } } }' > "$(CLAUDE_SETTINGS)"; \
echo "Created $(CLAUDE_SETTINGS) with canopy MCP server"; \
fi
fmt:
cargo fmt
lint:
cargo clippy --all-targets
lint-ci:
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
install-hooks:
git config core.hooksPath .githooks
chmod +x .githooks/pre-push
@echo "Installed git hooks from .githooks/"
clean:
cargo clean