trimdown 0.1.3

File compression CLI tool for PowerPoint, PDF, Video, and Word documents
Documentation
.PHONY: all build install test clean release lint fmt

# Default target
all: build

# Build the project
build:
	cargo build --release

# Install locally
install: build
	@echo "Installing trimdown to ~/.local/bin..."
	@mkdir -p ~/.local/bin
	@cp target/release/trimdown ~/.local/bin/
	@chmod +x ~/.local/bin/trimdown
	@echo "✓ Installed to ~/.local/bin/trimdown"
	@echo ""
	@if [[ ":$$PATH:" != *":$$HOME/.local/bin:"* ]]; then \
		echo "⚠ Warning: ~/.local/bin is not in your PATH"; \
		echo "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):"; \
		echo "export PATH=\"\$$PATH:$$HOME/.local/bin\""; \
	fi

# Run tests
test:
	cargo test

# Run linter
lint:
	cargo clippy -- -D warnings

# Format code
fmt:
	cargo fmt

# Check formatting
fmt-check:
	cargo fmt -- --check

# Create a release (usage: make release VERSION=0.1.0)
release:
	@if [ -z "$(VERSION)" ]; then \
		echo "Usage: make release VERSION=x.x.x"; \
		exit 1; \
	fi
	@./scripts/release.sh $(VERSION)

# Update Homebrew formula (usage: make update-brew VERSION=0.1.0)
update-brew:
	@if [ -z "$(VERSION)" ]; then \
		echo "Usage: make update-brew VERSION=x.x.x"; \
		exit 1; \
	fi
	@./scripts/update-formula.sh $(VERSION)

# Clean build artifacts
clean:
	cargo clean

# Run all checks
check: lint fmt-check test
	@echo "✓ All checks passed!"

# Install using the install script
install-script:
	@./scripts/install.sh