X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/638342a08e62388aa223d6da5de0f40efab47056..3e15c7e178bf62658a23570a628ff6e989d32ea9:/Makefile diff --git a/Makefile b/Makefile index 48a4ccb..1f63f7c 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,30 @@ APATH := $(realpath .) RPATH := $(subst $(wildcard ~/),,$(APATH)) -FILES := -DOTFILES := bash* flexget vim* +FILES := bin +DOTFILES := aliasesrc bash* flexget vim* zsh* .PHONY: install $(FILES) $(DOTFILES) install: $(FILES) $(DOTFILES) $(FILES): - @if [[ -f ~/$@ || -d ~/$@ ]]; then \ - if [[ -d $@ ]]; then \ - cp -r ~/$@/* $@; \ - else \ - cp -r ~/$@ $@; \ - fi; \ - rm -r ~/$@; \ + @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \ + if [[ -d $@ ]]; then \ + cp -r ~/$@/* $@; \ + else \ + cp -r ~/$@ $@; \ + fi; \ + rm -r ~/$@; \ fi; - ln -sf $(RPATH)/$@ ~/.$@ + ln -sfT $(RPATH)/$@ ~/$@ $(DOTFILES): - @if [[ -f ~/.$@ || -d ~/.$@ ]]; then \ - if [[ -d $@ ]]; then \ - cp -r ~/.$@/* $@; \ - else \ - cp -r ~/.$@ $@; \ - fi; \ - rm -r ~/.$@; \ + @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \ + if [[ -d .$@ ]]; then \ + cp -r ~/.$@/* $@; \ + else \ + cp -r ~/.$@ $@; \ + fi; \ + rm -r ~/.$@; \ fi; - ln -sf $(RPATH)/$@ ~/.$@ + ln -sfT $(RPATH)/$@ ~/.$@