From 62b712a184b3ee014b54d2b5d74e5207a536dbfc Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 11 Feb 2015 13:31:35 +0900 Subject: [PATCH] Do nothing when dotfiles_dir is explicitly defined --- Makefile | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index e2e09bd..50fb827 100644 --- a/Makefile +++ b/Makefile @@ -21,20 +21,26 @@ endif current_origin_url := $(shell git config remote.origin.url) -ifneq (,$(findstring $(dotfiles_git_path),$(current_origin_url))) -$(warning Currently in dotfiles repository) -dotfiles_dir := $(PWD) -else -ifeq (,$(dotfiles_dir)) -ifeq (,$(DOTFILES_DIR)) -$(warning Neigher DOTFILES_DIR nor dotfiles_dir not defined) -$(warning Use default value) -dotfiles_dir := $(home)/10sr_dotfiles -else -$(warning dotfiles_dir is set from DOTFILES_DIR) -dotfiles_dir := $(DOTFILES_DIR) -endif -endif +ifneq (,$(dotfiles_dir)) + + ifneq (,$(findstring $(dotfiles_git_path),$(current_origin_url))) + $(warning Currently in dotfiles repository) + dotfiles_dir := $(PWD) + + else + # Current directory is not 10sr/dotfiles.git reposioty + ifeq (,$(DOTFILES_DIR)) + $(warning Neigher DOTFILES_DIR nor dotfiles_dir is defined) + $(warning Use default value) + dotfiles_dir := $(home)/10sr_dotfiles + else + # dotfiles_dir is empty but DOTFILES_DIR has a value + $(warning dotfiles_dir is set from DOTFILES_DIR) + dotfiles_dir := $(DOTFILES_DIR) + endif + + endif + endif $(warning dotfiles_dir: $(dotfiles_dir))