|
1 #!/usr/bin/env ruby |
|
2 # vim: et sts=2 sw=2 fdm=marker |
|
3 |
|
4 # we don't yet have rbenv so keep safe for ruby 1.8 |
|
5 |
|
6 if `which git` == '' |
|
7 puts "please install git" |
|
8 exit 1 |
|
9 end |
|
10 |
|
11 |
|
12 # just checks and bails after each call |
|
13 def do_cmds (*cmds) |
|
14 cmds.each do |cmd| |
|
15 puts "$ #{cmd}" |
|
16 system( cmd ) or exit $? |
|
17 end |
|
18 end |
|
19 |
|
20 |
|
21 |
|
22 # oh-my-zsh {{{ |
|
23 # i have a custom theme and the omz install complains about already |
|
24 # having a directory there. remove, install, then revert my stuff |
|
25 # out of hg |
|
26 |
|
27 if Dir.exists?('.oh-my-zsh/.git') |
|
28 puts "oh-my-zsh already installed" |
|
29 else |
|
30 puts "Installing oh-my-zsh..." |
|
31 |
|
32 do_cmds \ |
|
33 '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 |
|
36 end |
|
37 |
|
38 # }}} |
|
39 |
|
40 |
|
41 # plenv {{{ |
|
42 |
|
43 if Dir.exists?('.plenv') |
|
44 puts "plenv already installed" |
|
45 else |
|
46 puts "Installing plenv..." |
|
47 |
|
48 do_cmds \ |
|
49 'git clone git://github.com/tokuhirom/plenv.git .plenv', |
|
50 'git clone git://github.com/tokuhirom/Perl-Build.git .plenv/plugins/perl-build/' |
|
51 |
|
52 end |
|
53 |
|
54 # }}} |
|
55 |
|
56 |
|
57 # rbenv {{{ |
|
58 if Dir.exists?('.rbenv') |
|
59 puts "rbenv already installed" |
|
60 else |
|
61 puts "Installing rbenv..." |
|
62 |
|
63 do_cmds \ |
|
64 'git clone https://github.com/sstephenson/rbenv.git .rbenv', |
|
65 'git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build/' |
|
66 |
|
67 end |
|
68 # }}} |
|
69 |
|
70 |
|
71 |