From a3b2955e60e45c8abcdc7f5900ba7f8bd2b76036 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Thu, 5 Sep 2019 15:21:41 +0000 Subject: [PATCH] Fixed issue stemming from eval order in make if statement. So I found a rather weird issue. The makefile was evaling the conditional of a target before that target is called. `make install` is a empty target with a ordered dependency: `init` and `update`. In the `init` script section it will install the `~/.zplug` zsh dependency, and the update script checks to see if that target exist, aborting if it doesn't. The issue is that running `make install` will install the `~/.zplug` dir, then report that the dir doesn't exist. Where running `make init && make update` will work as expected. There is probably some flag in make to resolve this, but I was unable to to find any documentation for this. --- zsh/makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/zsh/makefile b/zsh/makefile index 976068d..d4f5146 100644 --- a/zsh/makefile +++ b/zsh/makefile @@ -22,12 +22,10 @@ endif update: -ifeq ($(shell [ -e $(ZPLUG_DIR) ] $(return_val_truthy) ), true) - echo "=> Updating zplug" - source $(ZPLUG_DIR)/init.zsh ; zplug install ; zplug update -else - $(report) warn "No zplug install detected. Skipping." -endif + [ -e $(ZPLUG_DIR) ] \ + && ( echo "=> Updating zplug" \ + source $(ZPLUG_DIR)/init.zsh ; source $(ZSH_DIR)/zplug ; zplug install ; zplug update ) \ + || $(report) warn "No zplug install detected. Skipping." remove: ifeq ($(shell [ -e $(ZPLUG_DIR) ] $(return_val_truthy) ), true)