-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.zsh
More file actions
executable file
·78 lines (62 loc) · 2.35 KB
/
Copy pathbootstrap.zsh
File metadata and controls
executable file
·78 lines (62 loc) · 2.35 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
#!/usr/bin/env bash
# this script initialises a new computer with shell settings I am familar with
set -e
echo "Installing oh-my-zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "Installing xcode CLI tools"
xcode-select --install || true
if ! command -v brew > /dev/null;
then
echo "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "Linking RC files "
mkdir -p ~/.dotfiles_backup
for f in rc_files/*; do
file_name=$(basename "$f")
echo " processing RC file: \"$file_name\""
if [ -L ~/.$file_name ]; then
echo " Original symlink exists, backing it up"
mv ~/.$file_name ~/.dotfiles_backup/$file_name
fi
echo " *********** Linking \"$file_name\""
echo " SOURCE FILE PATH: ""$PWD"/$f
ln -s "$PWD"/$f ~/.$file_name 2> /dev/null # || echo "error linking files" && exit 1
echo " Linked \"$file_name\""
done
echo "link Sublime Text"
if [ -f "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ] \
&& [ ! -e /usr/local/bin/subl ]; then
ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
else
echo "already exists, skipping"
fi
echo "brew installs"
software_list=( gcc bash tig icdiff
vim zsh-syntax-highlighting \
zsh-autosuggestions python kubectx watch )
for item in "${software_list[@]}"; do
if ! brew list | grep -q "$item"; then
echo "Installing fresh $item"
brew install "$item"
# add comment and 'source' cmd only if it was not already in zshrc file
if [ "$item" == "zsh-autosuggestions" ] && ! grep -q "# adding zsh-autosuggestions.zsh" "zshrc" ; then
echo "Also adding source to zshrc file..."
printf "\
\n\n# adding zsh-autosuggestions.zsh \
\nsource /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >> zshrc
fi
else
echo "attempt to upgrade $item"
# brew upgrade "$item" || true
fi
done
if [ ! -f ~/.vim/autoload/plug.vim ]; then
echo "Installing Vim-Plug"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
echo "Configuring VIM"
vim +PlugInstall +qall
cp patches/minimap_settings.py ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User
echo "Done configuring the system......."