-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (52 loc) · 1.88 KB
/
Makefile
File metadata and controls
60 lines (52 loc) · 1.88 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
59
60
# Default target
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help message
@echo "Available targets:"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
@echo ""
.PHONY: setup teardown
setup: ## Complete setup: install tools + create symlinks + install git hooks (fresh machine)
@src/install-tools.sh
@echo ""
@echo "Tools installed! Now creating symlinks..."
@echo ""
@src/symlink-manager.sh install
@echo ""
@$(MAKE) --no-print-directory hooks
teardown: unlink ## (alias for `unlink`)
.PHONY: hooks
hooks: ## Install git hooks from .githooks/
@git config core.hooksPath .githooks
@echo "✓ Git hooks installed (.githooks/)"
.PHONY: status
status: ## Show installation status of tools and dotfiles
@src/check-tools.sh || true
@echo ""
@echo ""
@src/symlink-manager.sh status || true
.PHONY: install
install: ## Install required CLI tools (via pkg mgr)
@src/install-tools.sh
.PHONY: link unlink
link: ## Create symlinks for dotfiles
@src/symlink-manager.sh install
unlink: ## Remove all dotfile symlinks
@src/symlink-manager.sh uninstall
.PHONY: restore
restore: ## Restore files from a backup directory
@src/symlink-manager.sh restore
.PHONY: test test-shell test-clean
test: ## Run tests in Docker (all, or F=path/to/test.bats for single file)
@tests/test-runner.sh $(if $(F),$(F),all)
test-shell: ## Drop into test container for debugging
@tests/test-runner.sh shell
test-clean: ## Remove test Docker images and containers
@docker ps -a | grep dotfiles-test | awk '{print $$1}' | xargs -r docker rm 2>/dev/null || true
@docker images | grep dotfiles-test | awk '{print $$3}' | xargs -r docker rmi 2>/dev/null || true
@echo "✓ Test containers and images removed"
.PHONY: dev-shell
dev-shell: ## Interactive shell with dotfiles pre-installed (Ubuntu)
@tests/test-runner.sh dev