.PHONY: build install clean test release help
all: build
build:
cargo build
release:
cargo build --release
install:
cargo install --path .
install-local: release
mkdir -p ~/.local/bin
cp target/release/claude-hook-advisor ~/.local/bin/
@echo "claude-hook-advisor installed to ~/.local/bin/claude-hook-advisor"
@echo "Make sure ~/.local/bin is in your PATH"
install-system: release
sudo cp target/release/claude-hook-advisor /usr/local/bin/
@echo "claude-hook-advisor installed to /usr/local/bin/claude-hook-advisor"
test:
cargo test -- --test-threads=1
clean:
cargo clean
fmt:
cargo fmt
lint:
cargo clippy -- -D warnings
check:
cargo check
run-example:
echo '{"session_id":"test","transcript_path":"","cwd":"","hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"npm install","description":"Install packages"}}' | cargo run -- --hook
help:
@echo "Available targets:"
@echo " build - Build in debug mode"
@echo " release - Build in release mode"
@echo " install - Install using cargo (globally available)"
@echo " install-local - Install to ~/.local/bin"
@echo " install-system- Install system-wide (requires sudo)"
@echo " test - Run tests"
@echo " clean - Clean build artifacts"
@echo " fmt - Format code"
@echo " lint - Run clippy linting"
@echo " check - Check code without building"
@echo " run-example - Test with example JSON input"
@echo " help - Show this help"