-
Notifications
You must be signed in to change notification settings - Fork 28
/
shells.rb
30 lines (25 loc) · 814 Bytes
/
shells.rb
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
meta :shell_setup do
template {
met? { '/etc/shells'.p.grep(which(basename)) }
meet { append_to_file which(basename), '/etc/shells', :sudo => true }
}
end
dep 'fish.shell_setup' do
requires 'fish.src'
end
dep 'fish.src' do
requires 'ncurses.managed', 'coreutils.managed', 'gettext.lib'
source "git://github.com/benhoskings/fish.git"
end
dep 'zsh', :username do
username.default!(shell('whoami'))
requires 'zsh.shell_setup'
# It would be great to be able to do this, but GNU `login` doesn't have '-f'.
# met? { shell("login -f '#{username}' env").val_for('SHELL') == which('zsh') }
met? { shell("sudo su - '#{username}' -c 'echo $SHELL'") == which('zsh') }
meet { sudo("chsh -s '#{which('zsh')}' #{username}") }
end
dep 'zsh.shell_setup' do
requires 'zsh.bin'
end
dep 'zsh.bin'