-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit
More file actions
executable file
·50 lines (41 loc) · 798 Bytes
/
Copy pathinit
File metadata and controls
executable file
·50 lines (41 loc) · 798 Bytes
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
46
47
48
49
50
#!/usr/bin/env ruby
require 'fileutils'
xmonad_dots = %w(
.Xmodmap
.Xdefaults
.xmonad
.xinitrc
)
obsolete_dots = %w(
.bashrc
)
dots = %w(
.vimrc
.gvimrc
.vim
.irbrc
.gitconfig
.tmux.conf
bin
.emacs.d
.zsh
.zshrc
.zshenv
)
Dir.chdir 'dotfiles' do
`git submodule update --init`
end
FileUtils.mkdir_p 'dotfiles/old'
dots.each do |dot|
if File.exist?(dot) && File.stat(dot).ino != File.stat("dotfiles/#{dot}").ino
puts "mv #{dot} dotfiles/old/#{dot}"
FileUtils.mv(dot, "dotfiles/old/#{dot}")
puts "ln -s dotfiles/#{dot} #{dot}"
FileUtils.ln_s("dotfiles/#{dot}", dot)
end
unless File.exist?(dot)
puts "ln -s dotfiles/#{dot} #{dot}"
FileUtils.ln_s("dotfiles/#{dot}", dot)
end
end
system('echo :BundleInstall | vi -s /dev/stdin')