Generally guard clauses > if else
This commit is contained in:
parent
f91ca86a82
commit
5562f431d0
22
zsh/makefile
22
zsh/makefile
|
@ -20,29 +20,27 @@ init:
|
||||||
; $(report) "updating cache permissions"
|
; $(report) "updating cache permissions"
|
||||||
|
|
||||||
init_zplug:
|
init_zplug:
|
||||||
if [ ! -e $(ZPLUG_DIR) ] ; then
|
if [ -e $(ZPLUG_DIR) ] ; then
|
||||||
|
$(report) debug "zplug already installed. Skipping"
|
||||||
|
return
|
||||||
|
fi
|
||||||
export ZPLUG_HOME=$(ZPLUG_DIR)
|
export ZPLUG_HOME=$(ZPLUG_DIR)
|
||||||
git clone https://github.com/zplug/zplug $(ZPLUG_DIR) \
|
git clone https://github.com/zplug/zplug $(ZPLUG_DIR) \
|
||||||
; $(report) "zplug installed"
|
; $(report) "zplug installed"
|
||||||
else
|
|
||||||
$(report) debug "zplug already installed. Skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
update:
|
update:
|
||||||
if [ -e $(ZPLUG_DIR) ] ; then
|
if [ ! -d $(ZPLUG_DIR) ] ; then
|
||||||
|
$(report) error "$(ZPLUG_DIR) doesn't exist - run init first."
|
||||||
|
return
|
||||||
|
fi
|
||||||
$(report) header "Updating zplug"
|
$(report) header "Updating zplug"
|
||||||
source $(ZPLUG_DIR)/init.zsh
|
source $(ZPLUG_DIR)/init.zsh
|
||||||
source $(ZSH_DIR)/zplug
|
source $(ZSH_DIR)/zplug
|
||||||
export zplugs
|
export zplugs
|
||||||
zplug install
|
zplug install
|
||||||
zplug update \
|
zplug update ; $(report) "zplug upate"
|
||||||
; $(report) "zplug upate"
|
zplug clean ; $(report) "zplug cleaned"
|
||||||
zplug clean \
|
|
||||||
; $(report) "zplug cleaned"
|
|
||||||
else
|
|
||||||
$(report) error "$(ZPLUG_DIR) doesn't exist - run init first."
|
|
||||||
fi
|
|
||||||
|
|
||||||
remove:
|
remove:
|
||||||
rm -rf $(ZPLUG_DIR) ; $(report) "deleting zplug dir"
|
rm -rf $(ZPLUG_DIR) ; $(report) "deleting zplug dir"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user