-
Notifications
You must be signed in to change notification settings - Fork 0
/
.homesickrc
74 lines (65 loc) · 2.17 KB
/
.homesickrc
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
require 'readline'
require 'pathname'
require 'fileutils'
require 'os'
if OS.mac?
# Homebrew installation
puts 'Checking for Homebrew...'
unless system 'which brew'
puts 'Installing Homebrew...'
unless system '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
raise 'Error installing homebrew.'
end
puts '...success!'
else
puts 'Homebrew already installed.'
end
puts 'Tapping brew-bundle...'
unless system 'brew tap Homebrew/bundle'
raise 'Error tapping Homebrew/bundle.'
end
puts '...success!'
# Brewfile installation
puts 'Installing Brewfile bundle...'
unless system 'brew bundle install -v'
raise 'Error installing Brewfile bundle.'
end
puts '...success!'
# macOS system settings
puts 'Applying Mac system settings...'
unless system 'bash ./mac/system-settings.sh'
raise 'Error applying system settings'
end
puts '...success!'
# iTerm 2 preferences
puts 'Configuring iTerm2 preferences...'
unless system 'defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/.homesick/repos/dotfiles/preferences"'
raise 'Error setting iTerm2 custom preferences location'
end
unless system 'defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true'
raise 'Error setting iTerm2 preferences to load from custom folder'
end
puts '...success!'
# gnupg pinentry-mac
puts 'Configuring gnupg...'
homebrew_pinentry_mac_path=`brew --prefix pinentry-mac`.strip
system "echo \"pinentry-program #{homebrew_pinentry_mac_path}/bin/pinentry-mac\" >> ~/.gnupg/gpg-agent.conf"
puts '...success!'
end
# zsh as default shell
puts 'Setting zsh as default shell...'
if OS.mac?
homebrew_zsh_path=`brew --prefix zsh`.strip + '/bin/zsh'
system "sudo sh -c 'echo \"#{homebrew_zsh_path}\" >> /etc/shells'"
system "chsh -s \"#{homebrew_zsh_path}\""
else
system 'chsh -s /bin/zsh'
end
puts '...success!'
# git user info
puts 'Configuring git user info...'
email = Readline.readline('Email address: ')
unless system "git config --file ~/.gitconfig-private user.email #{email}"
raise 'Error setting email address in git.'
end
puts '...success!'