summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 15 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 26e2909..913468b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,23 @@
all:
-install:
+# We won't nuke people's dotfiles by default
+install: install-bin
+
+install-bin:
mkdir -p $$HOME/bin 2>/dev/null
for f in bin/*; do \
bn=$$(basename $$f); \
ln -sf $$(pwd)/bin/$$bn ~/bin; \
done
- for f in dotfiles/*; do \
- bn=$$(basename $$f); \
- ln -sf $$(pwd)/dotfiles/$$bn ~/.$$bn; \
+
+install-dotfiles:
+ @for f in dotfiles/*; do \
+ bn=$$(basename $$f); target=$$HOME/.$$bn; \
+ if test -f $$target -a '!' -L $$target; then \
+ echo "error: $$target exists; remove it to opt-in to installation, then"; \
+ echo " rerun make install-dotfiles"; \
+ else \
+ echo "Installing $$target"; \
+ ln -sf $$(pwd)/dotfiles/$$bn $$target; \
+ fi; \
done