forked from paulirish/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup-a-new-machine.sh
executable file
·179 lines (138 loc) · 6.7 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Props to Paul Irish for this one:
# https://github.com/paulirish/dotfiles/blob/master/setup-a-new-machine.sh
# 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 #
###############################################################################
# TODO: Previously did this via App Store. Try this next time:
# 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
###############################################################################
# Homebrew #
###############################################################################
# Install:
#/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install all the things
#./brew.sh
#./brew-cask.sh
# Check for new hawtness at:
# https://github.com/paulirish/dotfiles/blob/master/brew.sh
# https://github.com/paulirish/dotfiles/blob/master/brew-cask.sh
###############################################################################
# Git Open #
###############################################################################
# Type `git open` to open the GitHub page or website for a repository.
npm install -g git-open
###############################################################################
# Safe Trash #
###############################################################################
# Type `trash` as the safe `rm` alternative.
# Will move to Trash instead of removing immediately.
npm install -g trash-cli
###############################################################################
# Rupa Z #
###############################################################################
# https://github.com/rupa/z
# z, oh how I and Paul Irish love you.
cd
git clone https://github.com/rupa/z.git
chmod +x ~/z/z.sh
# rupa/z can now be installed via `homebrew`, tried but didn't work,
# so sticking with the above for now.
# Also consider moving over your current .z file if possible. it's painful to rebuild :)
# z binary is referenced from .bash_profile
###############################################################################
# Sublime Text Symlink #
###############################################################################
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/usr/local/bin/subl
# Had an issue on one machine with this regarding the path:
# https://stackoverflow.com/questions/25152711/subl-command-not-working-command-not-found
###############################################################################
# Photobook -> Dropbox #
###############################################################################
# Paul Irish's magic photobooth symlink -> dropbox. I love it.
# + First move Photo Booth folder out of Pictures
# + Then start Photo Booth. It'll ask where to put the library.
# + Put it in Dropbox/public
# * Now… you can record photobooth videos quickly and they upload to dropbox DURING RECORDING
# * Then you grab public URL and send off your video message in a heartbeat.
###############################################################################
# Extra Stuff to Test / Remove #
###############################################################################
# Other npm -g goodness I like
├── generator-webapp
├── gulp
├── gulp-cli
├── hexo
├── np (A better npm publish)
├── npm
├── prettier
├── yarn
└── yo
# TODO: Look at automating Dock Setup:
# https://github.com/kcrawford/dockutil
# Finder, Kiwi, Spotify,
# 'Space',
# Chrome, Firefox, Safari, Opera, Brave,
# 'Space'
# GitHub Desktop, Sublime Text, Visual Studio Code, iTerm, TextEdit
# 'Space'
# Transmit, Sequel Pro
# 'Space'
# Slack, Tweetbot, Rambox, System Preferences, Sketch, Gyazo GIF, SVG OMG (using https://www.fluidapp.com/)
# zip a folder and set a password.
# I always forget how to do this:
# zip -er archive.zip /path/to/directory/
# TODO: look at a better solution
# https://rvm.io
# rvm for the rubiess
#Paul does: curl -L https://get.rvm.io | bash -s stable --ruby
#I do this one as it adds dependencies as well
#\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable
# https://github.com/isaacs/nave
# needs npm, obviously.
# TODO: I think i'd rather curl down the nave.sh, symlink it into /bin and use that for initial node install.
#npm install -g nave
# https://github.com/dronir/SpotifyControl
# Spotify Control Script
#cd ~/code
#git clone git://github.com/dronir/SpotifyControl.git
# https://github.com/jeroenbegyn/VLCControl
# VLC Controll Script
#cd ~/code
#git clone git://github.com/jeroenbegyn/VLCControl.git
# https://ytdl-org.github.io/youtube-dl/download.html
# Download YouTube Videos
#brew install youtube-dl
#youtube-dl <youtube-link>
# Check gems are up to date without installing documentation
#sudo gem update --system --no-document
# Install jekyll
#sudo gem install jekyll
# Disable Updates for Sketch
#defaults write com.bohemiancoding.sketch3.plist SUEnableAutomaticChecks -bool false
# TODO: Add to .osx Sublime Text automation setup
# https://gist.github.com/pbojinov/24316c2a0f5651a347d1