forked from benhoskings/dot-files
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·127 lines (105 loc) · 3.41 KB
/
setup.sh
File metadata and controls
executable file
·127 lines (105 loc) · 3.41 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
set -e -u
LINK_FILE_DIR="`pwd`/files"
ls -1dA "$LINK_FILE_DIR/bin" $LINK_FILE_DIR/.* | while read f; do
[ "$f" == `pwd`/files/. ] ||
[ "$f" == `pwd`/files/.. ] ||
[ "$f" == `pwd`/files/.git ] ||
ln -vsf "$f" ~
done
mkdir -p ~/.ssh/
ln -vsf "$LINK_FILE_DIR/ssh_config" ~/.ssh/config
if [ ! `which brew` ]; then
echo "--> installing homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Homebrew already installed -- skipping"
fi
# Ensure analytics are off
brew analytics off
# if running on old install and to avoid errors when installing existing brew package, we upgrade first
brew upgrade
echo "--> installing brew packages"
source Brewfile
if [ ! `which rvm` ]; then
echo "--> installing RVM"
curl -sSL https://get.rvm.io | bash -s stable
else
echo "RVM already installed -- skipping"
fi
# echo "--> installing emacs"
# brew install emacs --cocoa --srgb --keep-ctag
# EMACS_BIN="/usr/local/bin/`readlink /usr/local/bin/emacs`"
# EMACS_HOME="`dirname $EMACS_BIN`/.."
# EMACS_APP="$EMACS_HOME/Emacs.app"
# echo " changing emacs icon"
# mv $EMACS_APP/Contents/Resources/Emacs.icns $EMACS_APP/Contents/Resources/Emacs.old.icns
# cp bin/Emacs.icns $EMACS_APP/Contents/Resources/
# echo " copying emacs to /Applications"
# cp -r $EMACS_APP /Applications/Emacs.app
# echo "Emacs installed successfully"
echo "--> Changing shell to zsh"
if [ "$SHELL" == '/bin/zsh' ]; then
echo "Already using zsh -- shipping"
else
chsh -s /bin/zsh $USER
fi
# Ensure we still have the homebrew utilities in /usr/local/bin in Apple silicon
if [[ ! -a /usr/local/bin/ ]]; then
sudo ln -s /opt/homebrew/bin /usr/local/bin
fi
echo "--> installing cask packages"
source Caskfile
echo "--> Installing pyton"
pyenv install -s 3.10.4
pyenv global system 3.10.4
echo "--> Installing aws tools"
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
rm AWSCLIV2.pkg
echo "--> link Visual Studio Code config"
VSC_SUPPORT_DIR="$HOME/Library/Application Support/Code/User"
mkdir -p "$VSC_SUPPORT_DIR"
ls -1dA `pwd`/vsc/* | while read f; do
ln -vsf "$f" "$VSC_SUPPORT_DIR"
done
EXTENSIONS=(
"arjun.swagger-viewer" \
"castwide.solargraph" \
"Dart-Code.dart-code" \
"Dart-Code.flutter" \
"dbaeumer.vscode-eslint" \
"eamodio.gitlens" \
"esbenp.prettier-vscode" \
"Flutterbricksproductions.flutterbricks" \
"gimenete.github-linker" \
"gmlewis-vscode.flutter-stylizer" \
"golang.go" \
"hashicorp.terraform" \
"karunamurti.haml" \
"LeetCode.vscode-leetcode" \
"mechatroner.rainbow-csv" \
"michelemelluso.code-beautifier" \
"ms-azuretools.vscode-docker" \
"ms-python.isort" \
"ms-python.python" \
"ms-python.vscode-pylance" \
"ms-vscode.makefile-tools" \
"Nash.awesome-flutter-snippets" \
"octref.vetur" \
"rebornix.Ruby" \
"redhat.vscode-yaml" \
"streetsidesoftware.code-spell-checker" \
"wingrunr21.vscode-ruby" \
)
echo " Installing VS Code extensions"
for EXTENSION in ${EXTENSIONS[@]}; do
code --install-extension $EXTENSION --force
done
echo "--> link iTerm2 config"
mkdir -p "$HOME/Library/Application Support/iTerm2/DynamicProfiles"
ln -vsf "`pwd`/iterm2/dynamic-profiles.json" "$HOME/Library/Application Support/iTerm2/DynamicProfiles"
echo "--> setup fzf"
$(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rc
echo "--> Configuring OSX"
source osx_config.sh