diff options
author | Mattias Andrée <maandree@kth.se> | 2021-06-25 18:09:21 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-06-25 18:09:21 +0200 |
commit | 6022e47b19161375fd2159299def5c76c915956d (patch) | |
tree | a863536cd6bf4b5c607ea00993e5666602ef8fd5 /emacs/Makefile | |
parent | Add instructions to README (diff) | |
download | dotfiles-6022e47b19161375fd2159299def5c76c915956d.tar.gz dotfiles-6022e47b19161375fd2159299def5c76c915956d.tar.bz2 dotfiles-6022e47b19161375fd2159299def5c76c915956d.tar.xz |
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'emacs/Makefile')
-rw-r--r-- | emacs/Makefile | 15 |
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\ |