-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.rb
More file actions
executable file
·45 lines (34 loc) · 1.14 KB
/
install.rb
File metadata and controls
executable file
·45 lines (34 loc) · 1.14 KB
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
#!/usr/bin/ruby
puts 'Installing the dotfiles'
path = File.expand_path('./', File.dirname(__FILE__))
bin_path = File.symlink?(path) ? File.readlink(path) : path
workbench_path = File.expand_path('./', bin_path)
Dir.chdir(workbench_path) do
puts " Working in #{Dir.pwd}"
puts ' Pulling latest ...'
puts " #{`git pull`}"
puts ' Updating submodules ...'
puts " #{`git submodule -q foreach git pull -q origin master`}"
end
Dir.chdir(workbench_path + '/rcs') do
puts " Working in #{Dir.pwd}"
puts ' Creating symlinks ...'
Dir.glob('*') do |item|
`ln -sfh #{workbench_path}/rcs/#{item} ~/.#{item}`
end
end
puts " linking #{workbench_path}/vim to .vim"
`ln -sfh #{workbench_path}/vim ~/.vim`
puts " linking #{workbench_path}/git_template to .git_template"
`ln -sfh #{workbench_path}/git_template ~/.git_template`
# regenerate vim help tags with pathogen :Helptags
puts ' Updating vim help tags'
`vim -c 'call pathogen#helptags()|qa' > /dev/null`
# make sure vim backup dir exists
puts `mkdir -p ~/.vim/tmp`
# change shell to zsh
puts `chsh -s /bin/zsh`
# # setting crontab
# `crontab #{workbench_path}/crontab`
#
puts ' All done!'