-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.zsh
executable file
·49 lines (38 loc) · 1.24 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env zsh
set -e
if [[ "$HOME" != "/home"* ]]; then
echo "Your home directory is unusual: $HOME"
vared -p "Do you want to continue? [yN] " -c ans
case $ans in
[yY] ) ;;
* ) exit;;
esac
fi
function make_links {
for file in "$1"/*(D); do
name="${file:t}"
linkname="$2/$name"
# check if there is a non-link file that would be overwritten
if [ -e "$linkname" ] && [ ! -L "$linkname" ]; then
echo "Backing up: $linkname >> $linkname.bak"
mv "$linkname" "$linkname.bak"
fi
if [ -L "$linkname" ]; then
echo "Deleting old link $linkname"
rm "$linkname"
fi
echo "Linking $linkname -> $file"
ln -s "$file" "$linkname"
done
}
make_links "$HOME/.dotfiles/home" "$HOME"
make_links "$HOME/.dotfiles/bin" "$HOME/.local/bin"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
echo "Temparily adding .local/bin to PATH"
# force path array to be have unique items
typeset -U path
path+="$HOME/.local/bin"
# install useful python packages
pipx install tldr poetry
git config --global core.excludesfile ~/.gitignore-system
echo "Done. You may need to log in again to see the effect"