-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (82 loc) · 3.01 KB
/
Copy pathMakefile
File metadata and controls
101 lines (82 loc) · 3.01 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
STOW_FOLDERS=zsh tmux kitty skhd starship yabai borders bin vrapperrc yazi zathura lazygit nvim-vscode task ghostty nvim mise miu claude codex atuin direnv hammerspoon karabiner diffnav gh-dash agent-deck wtf delta rift vscode launchd git
SHELL := /bin/bash
.PHONY: help stow-install stow-uninstall stow-status test validate deps platform-test
help:
@echo "Dotfiles Management"
@echo ""
@echo "Installation:"
@echo " make stow-install - Install all dotfiles"
@echo " make stow-uninstall - Remove all dotfiles"
@echo " make stow-status - Check installation status"
@echo " make stow-<tool> - Install specific tool"
@echo " make unstow-<tool> - Remove specific tool"
@echo ""
@echo "Testing:"
@echo " make test - Run all tests"
@echo " make validate - Validate syntax"
@echo " make deps - Check dependencies"
@echo " make platform-test - Test platform compatibility"
@echo ""
@echo "Maintenance:"
@echo " make export-aliases - Export atuin aliases"
@echo " make import-aliases - Import atuin aliases"
@echo " make backup-aliases - Backup and commit aliases"
stow-install:
@cd dotfiles && for folder in $(STOW_FOLDERS); do \
echo "Stowing $$folder"; \
stow --no-folding -D -t $(HOME) $$folder 2>/dev/null || true; \
stow --no-folding -t $(HOME) $$folder; \
done
stow-uninstall stow-clean:
@cd dotfiles && for folder in $(STOW_FOLDERS); do \
echo "Unstowing $$folder"; \
stow -t $(HOME) -D $$folder 2>/dev/null || true; \
done
stow-status:
@echo "Checking stow status..."
@cd dotfiles && for folder in $(STOW_FOLDERS); do \
if stow -t $(HOME) -n -v $$folder 2>&1 | grep -q "LINK:"; then \
echo "✓ $$folder is installed"; \
else \
echo "✗ $$folder is not installed"; \
fi; \
done
# Individual tool targets
define make-stow-target
stow-$(1):
@echo "Stowing $(1)..."
@cd dotfiles && stow --no-folding -D -t $(HOME) $(1) 2>/dev/null || true
@cd dotfiles && stow --no-folding -t $(HOME) $(1)
unstow-$(1):
@echo "Unstowing $(1)..."
@cd dotfiles && stow -t $(HOME) -D $(1) 2>/dev/null || true
endef
$(foreach tool,$(STOW_FOLDERS),$(eval $(call make-stow-target,$(tool))))
# CI/CD Testing
test: validate deps platform-test
@echo "All tests passed!"
validate:
@./scripts/ci/validate.sh
deps:
@./scripts/ci/check-dependencies.sh
platform-test:
@./scripts/ci/test-platforms.sh
install-test:
@./scripts/ci/test-install.sh
# Docker testing
docker-test-ubuntu:
@docker build -t dotfiles-test:ubuntu -f tests/ci/Dockerfile.ubuntu .
@docker run --rm dotfiles-test:ubuntu
docker-test-arch:
@docker build -t dotfiles-test:arch -f tests/ci/Dockerfile.arch .
@docker run --rm dotfiles-test:arch
docker-test: docker-test-ubuntu docker-test-arch
# Atuin alias management
export-aliases:
@./scripts/export-atuin-aliases.sh
import-aliases:
@./scripts/import-atuin-aliases.sh
# Backup aliases before any major changes
backup-aliases: export-aliases
@git add dotfiles/atuin/.config/atuin/aliases.sh
@git commit -m "backup: export current atuin aliases" || true