-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-machine.sh
executable file
·111 lines (85 loc) · 2.24 KB
/
setup-machine.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
if [[ -z $1 ]] || [[ -z $2 ]] ; then
echo "Usage ./setup-machine.sh <name> <email>"
exit 1
fi
read -p Ready?
echo Getting sudo over and done with
sudo echo
NAME=$1
EMAIL=$2
REPODIR=`pwd`
echo Changing git config
rm ~/.gitconfig
cat > ~/.gitconfig << EOL
[user]
name = ${NAME}
email = ${EMAIL}
EOL
echo Installing Homebrew...
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo Generating SSH Key
ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -N ''
pbcopy < ~/.ssh/id_rsa.pub
echo "Your SSH key is now in your clipboard! Go to https://github.com to add it"
read -p "Press enter to continue"
echo Installing zsh
brew install zsh
brew install zsh-syntax-highlighting
echo Installing oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/loket/oh-my-zsh/feature/batch-mode/tools/install.sh)" -s --batch || {
echo "Could not install Oh My Zsh" > /dev/stderr
exit 1
}
brew install toilet
brew install thefuck
brew install lolcat
echo Installing powerlevel9k
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
echo Enabling syntax highlighting in vim
mkdir -p ~/.vim/colors
curl https://raw.githubusercontent.com/erichdongubler/vim-sublime-monokai/master/colors/sublimemonokai.vim --output sublimemonokai.vim
mv sublimemonokai.vim ~/.vim/colors
cat > ~/.vimrc << EOL
syntax on
colorscheme sublimemonokai
EOL
brew install hub
eval "$(hub alias -s)"
echo Making folder in home dir
mkdir ~/Code
if [ -f repos.txt ]; then
echo Cloning repos in file
pushd ~/Code
while IFS= read -r repo
do
git clone $repo
done < $REPODIR/repos.txt
popd
else
echo No repos.txt file, skipping repo creation.
sleep 1
fi
brew update
brew tap homebrew/cask-fonts
while IFS= read -r cask
do
echo Installing $cask
brew install --cask $cask
done < $REPODIR/casks.txt
echo Using repo hyper config
mv ~/.hyper.js ~/.hyper.js.original # Keep the old one
# ln -s ${PWD}/.hyper.js ~/.hyper.js
cp .hyper.js ~
echo installing node.js
brew install node@14
npm i -g npm
npm i -g nvm
echo Installing GoLang
mkdir -p ~/Code/go/bin
brew install go
echo Copying over custom zshrc
mv ~/.zshrc ~/.zshrc_original # Keep original
# ln -s ${PWD}/.zshrc ~/.zshrc
cp .zshrc ~
echo Done!