summary refs log tree commit diff stats
path: root/hooks/post-up/zsh
blob: b7a7d4a2b1f9df74379e402a42c33026f0cf0f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env zsh
ZDOTDIR="${XDG_CONFIG_HOME:=~/.config}/zsh"

pushd $ZDOTDIR
for f in z*(-.)
do
	if [[ -e .$f ]]
	then
		if [[ ! -h .$f ]]
		then
			echo ".$f already exists as a regular file, ignoring"
		fi
	else
		ln -s $f .$f
	fi
done
popd

if [[ ! -d ~/.cache/zsh ]]
then
	mkdir -p ~/.cache/zsh
fi

if [[ -z $commands[zplug] && ! -d ~/projects/zplug/ ]]
then
	git clone git://github.com/zplug/zplug ~/projects/zplug/
fi

zsh -ic "zplug install"