-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·68 lines (53 loc) · 1.66 KB
/
install.sh
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/zsh
set -e
do_brew() {
if [[ "$1" != "--skip-brew" ]]; then
if [ ! $(which brew) ]; then
echo "[mac-dotfiles] Installing homebrew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo "[mac-dotfiles] Installing dependencies via Homebrew..."
brew tap anchore/grype
if brew bundle; then
echo "[mac-dotfiles] All dependencies installed"
else
echo "[mac-dotfiles] Error: Failed to install Homebrew dependencies"
fi
fi
}
do_brew $1
echo "[mac-dotfiles] Linking dotfiles..."
link_dotfiles() {
mv "$HOME/.gitconfig" "$HOME/.gitconfigOLD"
ln -s "$(pwd)/gitconfig" "$HOME/.gitconfig"
mv "$HOME/.zshrc" "$HOME/.zshrcOLD"
ln -s $(pwd)/zshrc $HOME/.zshrc
mv "$HOME/.zsh" "$HOME/.zshOLD"
ln -s $(pwd)/zsh $HOME/.zsh
if [[ -e "$HOME/.vimrc" ]]; then
mv "$HOME/.vimrc" "$HOME/.vimrcOLD"
fi
ln -s "$(pwd)/vimrc" "$HOME/.vimrc"
}
link_dotfiles
echo "[mac-dotfiles] Installing zshlilly in $HOME"
install_zshlilly() {
git clone https://github.com/MarkNenadov/zshlilly.git
cd zshlilly
./install.zsh $HOME
cd ..
rm -rf zshlilly
}
install_zshlilly
echo "[mac-dotfiles] Installing latest python"
install_latest_python() {
latest_version=$(pyenv install --list | grep -v - | grep -v b | tail -1)
pyenv install $latest_version
pyenv global $latest_version
}
install_latest_python || echo "[mac-dotfiles] failed installing python"
echo "[mac-dotfiles] Installing python dependencies"
python3 -m pip install -r python-requirements.txt
echo "[mac-dotfiles] Finished."