aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/Makefile')
-rw-r--r--emacs/Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/emacs/Makefile b/emacs/Makefile
index beebde0..23f2aa3 100644
--- a/emacs/Makefile
+++ b/emacs/Makefile
@@ -3,13 +3,18 @@ include ../common.mk
install:
mkdir -p -- ~/.config
- if test -d ~/.emacs.d; then \
- test ! -e ~/.config/emacs && \
- mv -- ~/.emacs.d ~/.config/emacs; \
+ if test -L ~/.emacs.d; then \
+ test "$$(readlink -- ~/.emacs.d)" = .config/emacs; \
else \
- mkdir -p -- ~/.config/emacs; \
+ set -e; \
+ if test -d ~/.emacs.d; then \
+ test ! -e ~/.config/emacs; \
+ mv -- ~/.emacs.d ~/.config/emacs; \
+ else \
+ mkdir -p -- ~/.config/emacs; \
+ fi; \
+ ln -sf -- .config/emacs ~/.emacs.d; \
fi
- ln -sf -- .config/emacs ~/.emacs.d
printf '; %s\n\n' 'This file is generated by ~/.dotfiles/emacs/Makefile' > ~/.config/emacs/init.el
cat -- init.el >> ~/.config/emacs/init.el
if $(CHECK_INSTALLED) emacs-go-mode 2>/dev/null; then\