-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
44 lines (39 loc) · 976 Bytes
/
Rakefile
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
require 'fileutils'
def symlink_(src, dst=nil)
dst = src if dst.nil?
dst_dir = File.expand_path("~/#{File.dirname(dst)}")
FileUtils.mkdir_p(dst_dir) unless File.directory?(dst_dir)
cmd = "ln -sfn #{File.expand_path(src)} ~/#{dst}"
puts cmd
system cmd
end
desc "Symlink"
task :symlink_dotfiles do
DONT_SYMLINK = %w(
.
..
.git
.gitignore
.gitmodules
.config
.local
.xmonad
.ncmpcpp
.rvm
.devilspie
Rakefile
README.md
firefox
) + Dir['.config/*']
entries = Dir['*'] + Dir['.*'] - DONT_SYMLINK
entries.each { |e| symlink_(e) }
symlink_('.xmonad/xmonad.hs')
symlink_('.config/fontconfig')
symlink_('.ncmpcpp/config')
symlink_('.config/autostart/mpd.desktop')
symlink_('.config/autostart/edit-server.desktop')
symlink_('.config/autostart/autocutsel.desktop')
symlink_('.config/autostart/xbindkeys.desktop')
# symlink_('.rvm/gemsets/global.gems')
end
task :default => :symlink_dotfiles