forked from alexisvincent/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.sh
executable file
·55 lines (46 loc) · 1.55 KB
/
init.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
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")"
# Create some default dir's
mkdir -p /usr/local/
#mkdir /usr/local/homebrew_temp
#mkdir $HOME/.go
#
# Execute bootstrap
echo "bootstrapping dotfiles symlinks"
sh bootstrap.sh
# Check if Homebrew is installed
if command -v brew &>/dev/null; then
echo "Homebrew is already installed."
else
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Execute brew installations
echo "running brew.sh script for brew packages"
sh brew.sh
# Set default shell
echo "Setting default shell to zsh"
chsh -s $(which zsh)
# Check if Oh My Zsh is already installed
if [ -d "$HOME/.oh-my-zsh" ]; then
echo "Oh My Zsh is already installed."
else
# Install Oh My Zsh
echo "Installing Oh My Zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Restore the symlinked .zshrc
if [ -f "$HOME/.zshrc.pre-oh-my-zsh" ]; then
echo "Restoring the symlinked .zshrc"
rm "$HOME/.zshrc"
mv "$HOME/.zshrc.pre-oh-my-zsh" "$HOME/.zshrc"
else
echo "No pre-Oh My Zsh .zshrc backup found."
fi
fi
# Clone zsh plugins
echo "Cloning zsh plugins"
ZSH_CUSTOM="$HOME/.oh-my-zsh/custom"
git clone https://github.com/zsh-users/zsh-completions $ZSH_CUSTOM/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
sh language_installs.sh