.homedir-setup.rb

Wed, 20 Aug 2014 13:28:20 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 20 Aug 2014 13:28:20 -0400
changeset 138
c033679345bd
parent 136
b634c40e658b
child 152
69896d410e89
permissions
-rwxr-xr-x

Update prompt is annoying

94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #!/usr/bin/env ruby
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 # vim: et sts=2 sw=2 fdm=marker
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
136
b634c40e658b Update, got omz files in right place
Meredith Howard <mhoward@roomag.org>
parents: 96
diff changeset
4 # we don't yet have rbenv so keep safe for ruby 1.9
94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 if `which git` == ''
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 puts "please install git"
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 exit 1
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 end
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11
136
b634c40e658b Update, got omz files in right place
Meredith Howard <mhoward@roomag.org>
parents: 96
diff changeset
12 # just checks and bails after each call, output already in STDERR
96
f4808ae73ead clean up
Meredith Howard <mhoward@roomag.org>
parents: 94
diff changeset
13 def do_cmds (*cmds)
f4808ae73ead clean up
Meredith Howard <mhoward@roomag.org>
parents: 94
diff changeset
14 cmds.each do |cmd|
f4808ae73ead clean up
Meredith Howard <mhoward@roomag.org>
parents: 94
diff changeset
15 puts "$ #{cmd}"
f4808ae73ead clean up
Meredith Howard <mhoward@roomag.org>
parents: 94
diff changeset
16 system( cmd ) or exit $?
94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 end
96
f4808ae73ead clean up
Meredith Howard <mhoward@roomag.org>
parents: 94
diff changeset
18 end
94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
19
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
20
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
22 # oh-my-zsh {{{
136
b634c40e658b Update, got omz files in right place
Meredith Howard <mhoward@roomag.org>
parents: 96
diff changeset
23 # some custom zsh files are already in .oh-my-zsh.cust
94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
24
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
25 if Dir.exists?('.oh-my-zsh/.git')
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
26 puts "oh-my-zsh already installed"
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
27 else
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28 puts "Installing oh-my-zsh..."
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30 do_cmds \
136
b634c40e658b Update, got omz files in right place
Meredith Howard <mhoward@roomag.org>
parents: 96
diff changeset
31 'git clone git://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh'
94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
32
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
33 end
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
34
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
35 # }}}
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
36
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
37
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
38 # plenv {{{
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
39
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
40 if Dir.exists?('.plenv')
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
41 puts "plenv already installed"
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
42 else
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
43 puts "Installing plenv..."
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
44
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
45 do_cmds \
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
46 'git clone git://github.com/tokuhirom/plenv.git .plenv',
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
47 'git clone git://github.com/tokuhirom/Perl-Build.git .plenv/plugins/perl-build/'
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
48
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
49 end
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
50
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
51 # }}}
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
52
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
53
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
54 # rbenv {{{
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
55 if Dir.exists?('.rbenv')
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
56 puts "rbenv already installed"
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
57 else
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
58 puts "Installing rbenv..."
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
59
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
60 do_cmds \
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
61 'git clone https://github.com/sstephenson/rbenv.git .rbenv',
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
62 'git clone https://github.com/sstephenson/ruby-build.git .rbenv/plugins/ruby-build/'
136
b634c40e658b Update, got omz files in right place
Meredith Howard <mhoward@roomag.org>
parents: 96
diff changeset
63
94
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
64 end
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
65 # }}}
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
66
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
67
51ca19919894 Try to make setup easier, unify shell environments
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
68

mercurial