.homedir-setup.rb

changeset 136
b634c40e658b
parent 96
f4808ae73ead
child 152
69896d410e89
equal deleted inserted replaced
135:e4b222f51eae 136:b634c40e658b
1 #!/usr/bin/env ruby 1 #!/usr/bin/env ruby
2 # vim: et sts=2 sw=2 fdm=marker 2 # vim: et sts=2 sw=2 fdm=marker
3 3
4 # we don't yet have rbenv so keep safe for ruby 1.8 4 # we don't yet have rbenv so keep safe for ruby 1.9
5 5
6 if `which git` == '' 6 if `which git` == ''
7 puts "please install git" 7 puts "please install git"
8 exit 1 8 exit 1
9 end 9 end
10 10
11 11
12 # just checks and bails after each call 12 # just checks and bails after each call, output already in STDERR
13 def do_cmds (*cmds) 13 def do_cmds (*cmds)
14 cmds.each do |cmd| 14 cmds.each do |cmd|
15 puts "$ #{cmd}" 15 puts "$ #{cmd}"
16 system( cmd ) or exit $? 16 system( cmd ) or exit $?
17 end 17 end
18 end 18 end
19 19
20 20
21 21
22 # oh-my-zsh {{{ 22 # oh-my-zsh {{{
23 # i have a custom theme and the omz install complains about already 23 # some custom zsh files are already in .oh-my-zsh.cust
24 # having a directory there. remove, install, then revert my stuff
25 # out of hg
26 24
27 if Dir.exists?('.oh-my-zsh/.git') 25 if Dir.exists?('.oh-my-zsh/.git')
28 puts "oh-my-zsh already installed" 26 puts "oh-my-zsh already installed"
29 else 27 else
30 puts "Installing oh-my-zsh..." 28 puts "Installing oh-my-zsh..."
31 29
32 do_cmds \ 30 do_cmds \
33 'git clone git://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh', 31 'git clone git://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh'
34 'hg stat -dn0 -I .oh-my-zsh/ | xargs -0 hg revert'
35 32
36 end 33 end
37 34
38 # }}} 35 # }}}
39 36
61 puts "Installing rbenv..." 58 puts "Installing rbenv..."
62 59
63 do_cmds \ 60 do_cmds \
64 'git clone https://github.com/sstephenson/rbenv.git .rbenv', 61 'git clone https://github.com/sstephenson/rbenv.git .rbenv',
65 'git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build/' 62 'git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build/'
66 63
67 end 64 end
68 # }}} 65 # }}}
69 66
70 67
71 68

mercurial