-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·76 lines (61 loc) · 2.04 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
69
70
71
72
73
74
75
#!/usr/bin/env bash
# This script aims to setup the macOS development environment.
sudo -v
dev="$HOME/Developer"
mkdir -p $dev
# Sync dotfiles
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
rsync --exclude ".git/" \
--exclude "etc/" \
--exclude ".DS_Store" \
--exclude "install.sh" \
--exclude "sdkman.sh" \
--exclude "brew.sh" \
--exclude "macos.sh" \
--exclude "README.md" \
-avh --no-perms . ~;
fi;
# Generate SSH keys
pub=$HOME/.ssh/id_rsa.pub
if [[ -f $pub ]]; then
echo 'SSH key is already exists, no need to generate..'
else
ssh-keygen -t rsa -b 4096 -C "[email protected]"
echo 'Generating SSH Key..'
fi
if [[ `uname` == 'Darwin' ]]; then
# Install Brew
xcode-select --install
which -s brew
if [[ $? != 0 ]]; then
echo 'Installing Homebrew...'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# To fix `__git_ps1: command not found`
git_prompt=$(brew --prefix)/etc/bash_completion.d/git-prompt.sh
[[ -f $git_prompt ]] || curl -o $git_prompt \
https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
echo 'Installing SDKMAN!..'
sh sdkman.sh
echo 'Installing brew packages..'
sh brew.sh
echo 'Installing node version manager...'
sh nvm.sh
echo 'Configuring MacOS..'
sh macos.sh
vundle=~/.vim/bundle/Vundle.vim
if [[ -d $vundle ]]; then
echo 'Vundle.vim already exists, no need to download..'
else
echo 'Installing Vundle Vim plug-in manager'..
git clone https://github.com/VundleVim/Vundle.vim.git $vundle
fi
vim +PluginInstall +qall
[[ -f $HOME/Library/Fonts/Monaco\ for\ Powerline.otf ]] || open etc/Monaco\ for\ Powerline.otf
open etc/onedark.itermcolors
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
fi
source ~/.bash_profile
echo 'Installation complete.'