2020-03-19 19:55:20 +00:00
|
|
|
# -*- mode: makefile-gmake; -*-
|
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)
|
2020-03-09 17:30:45 +00:00
|
|
|
$(MAKE) -C $(SRC) init_zplug
|
2019-05-01 03:29:37 +00:00
|
|
|
$(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
|
2020-08-21 22:01:04 +00:00
|
|
|
chmod 700 $(ZSH_DIR)/cache \
|
|
|
|
; $(report) "updating cache permissions"
|
2020-03-09 17:30:45 +00:00
|
|
|
|
|
|
|
init_zplug:
|
2021-05-11 19:11:30 +00:00
|
|
|
if [ -e $(ZPLUG_DIR) ] ; then
|
2020-03-09 17:30:45 +00:00
|
|
|
$(report) debug "zplug already installed. Skipping"
|
2021-05-11 19:11:30 +00:00
|
|
|
return
|
2020-03-09 17:30:45 +00:00
|
|
|
fi
|
2021-05-11 19:11:30 +00:00
|
|
|
export ZPLUG_HOME=$(ZPLUG_DIR)
|
|
|
|
git clone https://github.com/zplug/zplug $(ZPLUG_DIR) \
|
|
|
|
; $(report) "zplug installed"
|
2019-05-01 03:29:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
update:
|
2021-05-11 19:11:30 +00:00
|
|
|
if [ ! -d $(ZPLUG_DIR) ] ; then
|
2020-07-02 19:10:59 +00:00
|
|
|
$(report) error "$(ZPLUG_DIR) doesn't exist - run init first."
|
2021-05-11 19:11:30 +00:00
|
|
|
return
|
2020-03-09 17:30:45 +00:00
|
|
|
fi
|
2021-05-11 19:11:30 +00:00
|
|
|
$(report) header "Updating zplug"
|
|
|
|
source $(ZPLUG_DIR)/init.zsh
|
|
|
|
source $(ZSH_DIR)/zplug
|
|
|
|
export zplugs
|
|
|
|
zplug install
|
|
|
|
zplug update ; $(report) "zplug upate"
|
|
|
|
zplug clean ; $(report) "zplug cleaned"
|
2019-05-01 03:29:37 +00:00
|
|
|
|
|
|
|
remove:
|
2020-03-09 17:30:45 +00:00
|
|
|
rm -rf $(ZPLUG_DIR) ; $(report) "deleting zplug dir"
|
2019-05-01 03:29:37 +00:00
|
|
|
$(rm_link) ~/.zprofile
|
|
|
|
$(rm_link) ~/.zlogin
|
|
|
|
$(rm_link) ~/.zshrc
|
|
|
|
$(rm_link) ~/.zsh
|
|
|
|
$(rm_link) ~/.zshenv
|
2020-03-09 17:30:45 +00:00
|
|
|
$(rm_link) ~/.zlogout
|