-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (64 loc) · 2.09 KB
/
Makefile
File metadata and controls
74 lines (64 loc) · 2.09 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.PHONY: help install dock-preview dock-apply dock-restore test-brewfile test-zsh test test-unit clean
# Default target
help:
@echo "Available targets:"
@echo " make install - Run the full dotfiles installation"
@echo " make dock-preview - Preview Dock configuration changes (dry-run)"
@echo " make dock-apply - Apply Dock configuration"
@echo " make dock-restore - Restore Dock to macOS defaults"
@echo " make test - Run all tests"
@echo " make test-unit - Run unit tests for install.sh"
@echo " make test-brewfile - Validate Brewfile syntax"
@echo " make test-zsh - Syntax check zsh configuration"
@echo " make clean - Remove temporary installation directory"
# Run the full installation
install:
@echo "Running dotfiles installation..."
@bash install.sh
# Preview Dock configuration changes
dock-preview:
@echo "Previewing Dock configuration..."
@bash scripts/configure-dock.sh --dry-run
# Apply Dock configuration
dock-apply:
@echo "Applying Dock configuration..."
@bash scripts/configure-dock.sh
# Restore Dock to macOS defaults
dock-restore:
@echo "Restoring Dock to macOS defaults..."
@bash scripts/restore-dock.sh
# Validate Brewfile syntax
test-brewfile:
@echo "Validating Brewfile..."
@if [ -f ~/.Brewfile ]; then \
brew bundle check --global; \
else \
echo "Error: ~/.Brewfile not found. Run 'make install' first."; \
exit 1; \
fi
# Syntax check zsh configuration
test-zsh:
@echo "Checking zsh configuration syntax..."
@if [ -f ~/.zshrc ]; then \
zsh -n ~/.zshrc && echo "✓ .zshrc syntax is valid"; \
else \
echo "Error: ~/.zshrc not found. Run 'make install' first."; \
exit 1; \
fi
# Run all tests
test: test-unit
@echo "✓ All tests passed"
# Run unit tests for install.sh
test-unit:
@echo "Running unit tests..."
@if command -v bats >/dev/null 2>&1; then \
bats tests/install.bats; \
else \
echo "Error: bats not found. Install with 'brew install bats-core'"; \
exit 1; \
fi
# Clean up temporary installation directory
clean:
@echo "Cleaning up..."
@rm -rf ~/.dotfiles
@echo "✓ Removed ~/.dotfiles directory"