2019-05-01 03:29:37 +00:00
|
|
|
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
|
|
|
include ../lib/shared.mk
|
|
|
|
ZSH_DIR := ~/.zsh
|
|
|
|
ZPLUG_DIR := ~/.zplug
|
|
|
|
|
|
|
|
install: | init update
|
|
|
|
|
|
|
|
init:
|
|
|
|
$(info => Setting up zsh)
|
|
|
|
ifeq ($(shell [ ! -e $(ZPLUG_DIR) ] $(return_val_truthy) ), true)
|
|
|
|
export ZPLUG_HOME=$(ZPLUG_DIR) \
|
2019-05-03 02:16:58 +00:00
|
|
|
; git clone https://github.com/zplug/zplug $(ZPLUG_DIR) \
|
2019-12-20 15:14:15 +00:00
|
|
|
; source ~/.zplug/init.zsh && zplug update --self \
|
2019-05-01 03:29:37 +00:00
|
|
|
; $(report) "zplug installed"
|
|
|
|
endif
|
|
|
|
$(mk_link) $(SRC) ~/.zsh
|
|
|
|
$(mk_link) $(ZSH_DIR)/zshrc ~/.zshrc
|
|
|
|
$(mk_link) $(ZSH_DIR)/zlogin ~/.zlogin
|
|
|
|
$(mk_link) $(ZSH_DIR)/zprofile ~/.zprofile
|
|
|
|
$(mk_link) $(ZSH_DIR)/zshenv ~/.zshenv
|
2019-09-18 01:12:24 +00:00
|
|
|
$(mk_link) $(ZSH_DIR)/zlogout ~/.zlogout
|
2019-05-02 01:07:07 +00:00
|
|
|
chmod 700 $(ZSH_DIR)/transient
|
2019-05-01 03:29:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
update:
|
2019-09-05 15:21:41 +00:00
|
|
|
[ -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."
|
2019-05-01 03:29:37 +00:00
|
|
|
|
|
|
|
remove:
|
|
|
|
ifeq ($(shell [ -e $(ZPLUG_DIR) ] $(return_val_truthy) ), true)
|
|
|
|
$(report) warn "Leaving $(ZPLUG_DIR) directory."
|
|
|
|
endif
|
|
|
|
$(info => Removing zsh)
|
|
|
|
$(rm_link) ~/.zprofile
|
|
|
|
$(rm_link) ~/.zlogin
|
|
|
|
$(rm_link) ~/.zshrc
|
|
|
|
$(rm_link) ~/.zsh
|
|
|
|
$(rm_link) ~/.zshenv
|
2019-09-18 01:12:24 +00:00
|
|
|
$(mk_link) $(ZSH_DIR)/zlogout ~/.zlogout
|