From ee1e83b56be8870c9327111817de797ac95dcf67 Mon Sep 17 00:00:00 2001 From: Christian Busch Date: Mon, 18 Apr 2016 10:31:05 +0200 Subject: [PATCH] Added makefile for deployment, removed bootstrap.sh --- Makefile | 35 +++++++++++++++++++++++++++++++++++ bootstrap.sh | 8 -------- 2 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 Makefile delete mode 100755 bootstrap.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..18e39c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +DOTPATH := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) +CANDIDATES := $(wildcard .??*) +EXCLUSIONS := .DS_Store .git .gitmodules .gitignore init +DOTFILES := $(filter-out $(EXCLUSIONS), $(CANDIDATES)) + +all: install + +help: + @echo "make list #=> Show dot files in this repo" + @echo "make deploy #=> Create symlink to home directory" + @echo "make update #=> Fetch changes for this repo" + @echo "make install #=> Run make update, deploy, init" + @echo "make clean #=> Remove the dot files and this repo" + +list: + @$(foreach val, $(DOTFILES), /bin/ls -dF $(val);) + +deploy: + @echo '==> Start to deploy dotfiles to home directory.' + @echo '' + @$(foreach val, $(DOTFILES), ln -sfnv $(abspath $(val)) $(HOME)/$(val);) + +update: + git pull origin master + git submodule init + git submodule update + git submodule foreach git pull origin master + +install: update deploy + @exec $$SHELL + +clean: + @echo 'Remove dot files in your home directory...' + @-$(foreach val, $(DOTFILES), rm -vrf $(HOME)/$(val);) + -rm -rf $(DOTPATH) \ No newline at end of file diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 3a6fd36..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -git pull origin master -git submodule update --init -cp init/Smyck-Color-Scheme/smyck.vim .vim/colors/smyck.vim - -rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \ - --exclude "README.md" --exclude "init/" -avh --no-perms . ~ \ No newline at end of file