-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.zsh
executable file
·38 lines (30 loc) · 1023 Bytes
/
install.zsh
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
30
31
32
33
34
35
36
37
38
#!/usr/bin/env zsh
local dotpath dotfiles choice testrun installdir=$HOME
read "testrun?Would you like to perform a test run? (y/n) "
if [[ $1 = 'test' || "$testrun" =~ ^[yY]$ ]]; then
installdir=$HOME/dotfiles_test
if [[ ! -d "$installdir" ]]; then
mkdir $installdir
fi
echo "Adjusted install dir to $installdir, you can proceed safely."
fi
echo "This will symlink all dotfiles in this directory to your home dir"
read "choice?Are you sure you want to continue? (y/n) "
case "$choice" in
y|Y)
dotpath=$0:a:h
dotfiles=(.*)
for file in $dotfiles; do
if [[ "$file" =~ ^.gitignore$ || "$file" =~ ^.git$ ]]; then
continue
fi
echo "Linking $file in $installdir..."
ln -s $dotpath/$file $installdir/$file
done
echo "Done!"
echo "Be sure to set your ZSH_CUSTOM variable in ~/.zshrc to the path for '$dotpath/ohmyzsh_customs'"
echo "Also update the powerline paths at the bottom of ~/.tmux.conf to '$dotpath/tmux-powerline'"
;;
*)
;;
esac