-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (63 loc) · 2.43 KB
/
Makefile
File metadata and controls
72 lines (63 loc) · 2.43 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
all: install
# Clone external dependencies
fetch-pure:
@mkdir -p ~/.zsh
@if [ ! -d ~/.zsh/pure ]; then \
git clone https://github.com/sindresorhus/pure.git ~/.zsh/pure; \
echo "Pure prompt cloned."; \
else \
echo "Pure prompt already exists."; \
fi
fetch-tpm:
@mkdir -p ~/.config/tmux/plugins
@if [ ! -d ~/.config/tmux/plugins/tpm ]; then \
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm; \
echo "TPM cloned."; \
else \
echo "TPM already exists."; \
fi
# Initialize nvim with NvChad starter if not already done
init-nvim:
@if [ ! -f nvim/.config/nvim/init.lua ]; then \
echo "Initializing NvChad starter files..."; \
git clone https://github.com/NvChad/starter /tmp/nvchad-starter --depth 1; \
mkdir -p nvim/.config/nvim; \
cp -rn /tmp/nvchad-starter/* nvim/.config/nvim/; \
rm -rf /tmp/nvchad-starter; \
echo "NvChad starter initialized in dotfiles."; \
echo "NOTE: Your custom configs have been preserved."; \
else \
echo "NvChad already initialized in dotfiles."; \
fi
# Stow all configurations
stow-all:
@for d in `find . -mindepth 1 -maxdepth 1 -type d -not -path './.*'`; do \
stow -t $(HOME) -R $$(basename $$d); \
echo "$$(basename $$d) stowed."; \
done
# Main install target - correct order: init files first, then stow
install: init-nvim stow-all fetch-tpm fetch-pure
# Update NvChad base files
update-nvchad:
@echo "Updating NvChad base files..."
@git clone https://github.com/NvChad/starter /tmp/nvchad-starter --depth 1
@cp /tmp/nvchad-starter/init.lua nvim/.config/nvim/
@cp /tmp/nvchad-starter/LICENSE nvim/.config/nvim/
@cp /tmp/nvchad-starter/README.md nvim/.config/nvim/
@cp /tmp/nvchad-starter/lua/autocmds.lua nvim/.config/nvim/lua/
@cp /tmp/nvchad-starter/lua/configs/conform.lua nvim/.config/nvim/lua/configs/
@cp /tmp/nvchad-starter/lua/configs/lazy.lua nvim/.config/nvim/lua/configs/
@cp /tmp/nvchad-starter/lua/plugins/init.lua nvim/.config/nvim/lua/plugins/
@rm -rf /tmp/nvchad-starter
@echo "Done. Check 'git status' for any new untracked files."
# Clean target to remove existing configs for fresh install
clean:
@echo "Removing existing configurations..."
@rm -rf ~/.config/nvim
@rm -rf ~/.config/tmux/plugins/tpm
@rm -rf ~/.zsh/pure
@echo "Clean complete. Run 'make install' to reinstall."
# Legacy target for backward compatibility
stow-only: stow-all
.PHONY: fetch-pure fetch-tpm init-nvim stow-all update-nvchad install clean stow-only stow
stow: stow-only