-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
65 lines (54 loc) · 1.83 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
require 'rake'
require 'fileutils'
task :default => [:install_vim, :install_shell, :install_irbrc, :install_tmux ]
desc 'Install Vim Configs'
task :install_vim do |t|
homedir = File.expand_path "~"
minpac = File.join homedir,".vim", "pack", "minpac", "opt"
minpac_plug = File.join minpac, "minpac"
vimrc_src = File.join File.dirname(__FILE__), "vimrc"
vimrc_dst = File.join homedir,".vimrc"
# make sure that minipac exists
FileUtils::mkdir_p minpac
# if minipac doesn't exist, install it
unless File.exists? minpac_plug
FileUtils.cd minpac
`git clone https://github.com/k-takata/minpac.git`
end
puts "copying vim files"
FileUtils.cp vimrc_src, vimrc_dst
end
desc 'Install VCS type stuff'
task :install_vcs do |t|
puts "Installing git/hg configs"
homedir = File.expand_path("~")
["gitconfig"].each {|vcfile| FileUtils.cp("./#{vcfile}","#{homedir}/.#{vcfile}") }
end
desc 'Install shell related stuff'
task :install_shell do |t|
puts "installing zsh stuff"
homedir = File.expand_path("~")
dot_zsh = File.join(homedir,".zsh")
mkdir(dot_zsh) unless File.exists?(dot_zsh)
["zshrc","aliases","inputrc", "gemrc","dircolors"].each { |zfile| FileUtils.cp(zfile,"#{homedir}/.#{zfile}") }
end
desc 'Install postgres Related Stuff'
task :install_postgres do |t|
puts "installing postgres stuff.."
homedir = File.expand_path("~")
dot_psql = File.join(homedir,".psql")
mkdir(dot_psql) unless File.exists?(dot_psql)
FileUtils.cp("psqlrc",File.join(homedir,".psqlrc"))
end
desc 'Install IRB Related Stuff'
task :install_irbrc do |t|
puts "installing irbrc"
homedir = File.expand_path("~")
FileUtils.cp("./irbrc","#{homedir}/.irbrc")
end
desc 'install tmux stuff'
task :install_tmux do |t|
puts "installing tmux"
homedir = File.expand_path("~")
FileUtils.cp("./tmux.conf", "#{homedir}/.tmux.conf")
end