-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-a-new-machine.sh
84 lines (60 loc) · 2.89 KB
/
setup-a-new-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
# copy paste this file in bit by bit.
# don't run it.
echo "do not run this script in one go. hit ctrl-c NOW"
read -n 1
##############################################################################################################
### XCode Command Line Tools
# thx https://github.com/alrra/dotfiles/blob/ff123ca9b9b/os/os_x/installs/install_xcode.sh
if ! xcode-select --print-path &> /dev/null; then
# Prompt user to install the XCode Command Line Tools
xcode-select --install &> /dev/null
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Wait until the XCode Command Line Tools are installed
until xcode-select --print-path &> /dev/null; do
sleep 5
done
print_result $? 'Install XCode Command Line Tools'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Point the `xcode-select` developer directory to
# the appropriate directory from within `Xcode.app`
# https://github.com/alrra/dotfiles/issues/13
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
print_result $? 'Make "xcode-select" developer directory point to Xcode'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Prompt user to agree to the terms of the Xcode license
# https://github.com/alrra/dotfiles/issues/10
sudo xcodebuild -license
print_result $? 'Agree with the XCode Command Line Tools licence'
fi
###
##############################################################################################################
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# install all the things
./brew.sh
./brew-cask.sh
### install of common things
# autocompletion for git branch names https://git-scm.com/book/en/v1/Git-Basics-Tips-and-Tricks
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
# github.com/rupa/z - oh how i love you
# git clone https://github.com/rupa/z.git ~/code/z
# chmod +x ~/code/z/z.sh
# consider reusing your current .z file if possible. it's painful to rebuild :)
# z is hooked up in .bash_profile
# for the c alias (syntax highlighted cat)
sudo easy_install Pygments
# change to bash 4 (installed by homebrew)
BASHPATH=$(brew --prefix)/bin/bash
# https://github.com/paulirish/dotfiles/pull/64
sudo bash -c 'echo $(brew --prefix)/bin/bash >> /etc/shells'
chsh -s $BASHPATH # will set for current user only.
echo $BASH_VERSION # should be 4.x not the old 3.2.X
# Later, confirm iterm settings aren't conflicting.
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
# set up osx defaults
sh .macos
# move git credentials into ~/.gitconfig.local http://stackoverflow.com/a/13615531/89484
# now .gitconfig can be shared across all machines and only the .local changes
# symlink it up!
./symlink-setup.sh