Skip to content

Commit 148f706

Browse files
committed
Reorder steps in .homesickrc and update README
1 parent 3a8bf39 commit 148f706

File tree

2 files changed

+77
-55
lines changed

2 files changed

+77
-55
lines changed

.homesickrc

+51-43
Original file line numberDiff line numberDiff line change
@@ -4,95 +4,103 @@ require 'fileutils'
44
require 'os'
55

66
if OS.mac?
7-
# homebrew installation
7+
# Homebrew installation
8+
puts 'Checking for Homebrew...'
89
unless system 'which brew'
9-
puts 'Installing homebrew...'
10+
puts 'Installing Homebrew...'
1011
unless system 'ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'
1112
raise 'Error installing homebrew.'
1213
end
13-
puts 'homebrew successfully installed!'
14+
puts '...success!'
1415
else
15-
puts 'homebrew already installed.'
16+
puts 'Homebrew already installed.'
1617
end
1718

1819
puts 'Tapping brew-bundle...'
1920
unless system 'brew tap Homebrew/bundle'
2021
raise 'Error tapping Homebrew/bundle.'
2122
end
22-
puts 'brew-bundle successfully installed!'
23+
puts '...success!'
2324

2425
# Brewfile installation
2526
puts 'Installing Brewfile bundle...'
2627
unless system 'brew bundle install -v'
2728
raise 'Error installing Brewfile bundle.'
2829
end
29-
puts 'Brewfile bundle successfully installed!'
30+
puts '...success!'
3031

31-
# general system settings
32+
# Mac App Store apps
33+
puts 'Installing Mac App Store apps...'
34+
unless system 'bash ./mac/mac-app-store.sh'
35+
raise 'Error installing Mac App Store applications.'
36+
end
37+
puts '...success!'
38+
39+
# VSCode extensions
40+
puts 'Installing VSCode extensions...'
41+
unless system 'bash ./mac/vscode-extensions.sh'
42+
raise 'Error installing VSCode extensions.'
43+
end
44+
puts '...success!'
45+
46+
# Install fonts
47+
puts 'Installing fonts...'
48+
FileUtils.cp Dir.glob('./vendor/inconsolata/fonts/otf/*.otf'), "#{Dir.home}/Library/Fonts/"
49+
50+
# macOS system settings
51+
puts 'Applying Mac system settings...'
3252
unless system 'bash ./mac/system-settings.sh'
3353
raise 'Error applying system settings'
3454
end
35-
puts 'System settings applied successfully'
55+
puts '...success!'
3656

37-
# iTerm 2 preferences location
57+
# iTerm 2 preferences
58+
puts 'Configuring iTerm2 preferences...'
3859
unless system 'defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/.homesick/repos/dotfiles/preferences"'
3960
raise 'Error setting iTerm2 custom preferences location'
4061
end
4162

4263
unless system 'defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true'
4364
raise 'Error setting iTerm2 preferences to load from custom folder'
4465
end
45-
puts 'iTerm2 custom preferences location set.'
66+
puts '...success!'
4667

47-
# VSCode extensions
48-
unless system 'bash ./mac/vscode-extensions.sh'
49-
raise 'Error installing VSCode extensions.'
50-
end
51-
puts 'VSCode extensions successfully installed.'
68+
# gnupg pinentry-mac
69+
puts 'Configuring gnupg...'
70+
homebrew_pinentry_mac_path=`brew --prefix pinentry-mac`.strip
71+
system "echo \"pinentry-program #{homebrew_pinentry_mac_path}/bin/pinentry-mac\" >> ~/.gnupg/gpg-agent.conf"
72+
puts '...success!'
73+
end
5274

53-
# Mac App Store apps
54-
unless system 'bash ./mac/mac-app-store.sh'
55-
raise 'Error installing Mac App Store applications.'
56-
end
57-
puts 'Mac App Store applications installed.'
75+
# zsh as default shell
76+
puts 'Setting zsh as default shell...'
77+
if OS.mac?
78+
homebrew_zsh_path=`brew --prefix zsh`
79+
system "sudo sh -c 'echo \"#{homebrew_zsh_path}\" >> /etc/shells'"
80+
system "chsh -s \"#{homebrew_zsh_path}\""
81+
else
82+
system 'chsh -s /bin/zsh'
5883
end
84+
puts '...success!'
5985

6086
# oh-my-zsh installation
87+
puts 'Checking for oh-my-zsh...'
6188
ohmyzsh_path = Pathname.new "#{Dir.home}/.oh-my-zsh"
6289
unless ohmyzsh_path.exist?
6390
puts 'Installing oh-my-zsh...'
6491
unless system 'git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh'
6592
raise 'Error installing oh-my-zsh'
6693
end
6794
system 'chmod g-w,o-w ~/.oh-my-zsh'
68-
puts 'oh-my-zsh installed!'
95+
puts '...success!'
6996
else
7097
puts 'oh-my-zsh already installed.'
7198
end
7299

73-
puts 'Setting zsh as default shell...'
74-
if OS.mac?
75-
homebrew_zsh_path=`brew --prefix zsh`
76-
system "sudo sh -c 'echo \"#{homebrew_zsh_path}\" >> /etc/shells'"
77-
system "chsh -s \"#{homebrew_zsh_path}\""
78-
else
79-
system "chsh -s /bin/zsh"
80-
end
81-
82-
if OS.mac?
83-
puts "Installing fonts..."
84-
# Install Inconsolata
85-
FileUtils.cp Dir.glob("./vendor/inconsolata/fonts/otf/*.otf"), "#{Dir.home}/Library/Fonts/"
86-
87-
puts "Configuring gnupg..."
88-
homebrew_pinentry_mac_path=`brew --prefix pinentry-mac`.strip
89-
system "echo \"pinentry-program #{homebrew_pinentry_mac_path}/bin/pinentry-mac\" >> ~/.gnupg/gpg-agent.conf"
90-
end
91-
92-
# Private info prompts
93-
puts "Configuring git..."
100+
# git user info
101+
puts 'Configuring git user info...'
94102
email = Readline.readline('Email address: ')
95103
unless system "git config --file ~/.gitconfig-private user.email #{email}"
96104
raise 'Error setting email address in git.'
97105
end
98-
puts 'Email address set in git global configuration'
106+
puts '...success!'

README.md

+26-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,34 @@
22

33
## Installation
44

5-
gem install homesick os
6-
homesick clone geoffadams/dotfiles
7-
homesick symlink dotfiles
8-
homesick rc dotfiles
5+
```sh
6+
gem install homesick os
7+
homesick clone geoffadams/dotfiles
8+
homesick symlink dotfiles
9+
homesick rc dotfiles
10+
```
911

1012
## What it does
1113

12-
- Configuration for a whole bunch of tools
13-
- Installs homebrew
14-
- Installs a bunch of homebrew packages
15-
- Installs oh-my-zsh
16-
- Populates configuration with private information
14+
- Installs stuff:
15+
- Homebrew
16+
- Applications via Homebrew
17+
- Applications from the Mac App Store
18+
- VSCode extensions
19+
- Configures `zsh`
20+
- Sets `zsh` as the default shell (though no longer strictly necessary given `zsh` is default in macOS 10.15 and later)
21+
- Installs `oh-my-zsh`
22+
- Sets up my personal zsh configuration
23+
- Configures macOS with my personal preferences
24+
- Configures iTerm2 with my personal preferences
25+
- Installs fonts needed
26+
- Configures `git` user settings
27+
- Configures `vim`
28+
- Extensions
29+
- Preferences
1730

18-
## TODO
31+
## Stuff that would be nice
1932

20-
- Use cask to install other applications
21-
- Nicer command line interface
33+
- Configure more macOS settings as I realise they vary between machines
34+
- Be less Mac- and Homebrew-specific
35+
- Applyg settings more gracefully (e.g. don't trounce whole configs on already-configured systems)

0 commit comments

Comments
 (0)