-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
57 lines (43 loc) · 1.43 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
require 'rake'
require 'pathname'
namespace :spacemacs do
HOME = Pathname.new('~').expand_path
CONFIG_ROOT = Pathname.new(__FILE__).expand_path.dirname
master_checkout = CONFIG_ROOT.join('spacemacs_master')
dot_emacs = HOME.join('.emacs.d')
dot_spacemacs = HOME.join('.spacemacs')
dot_custom = HOME.join('.spacemacs.custom')
dot_machine = HOME.join('.spacemacs.machine-local')
spacemacs_config = CONFIG_ROOT.join('spacemacs.el')
machine_config = CONFIG_ROOT.join('machine-local.el')
directory master_checkout do
puts "cloning spacemacs_master"
puts `git clone https://github.com/syl20bnr/spacemacs spacemacs_master`
end
directory dot_emacs do
puts "Symlinking ~/.emacs.d -> spacemacs_master"
ln_s(master_checkout, dot_emacs)
end
file dot_spacemacs do
puts "Symlinking ~/.spacemacs -> spacemacs.el"
ln_s(spacemacs_config, dot_spacemacs)
end
file dot_custom do
touch dot_custom
end
file machine_config do
touch machine_config
end
file dot_machine do
puts "Symlinking ~/.spacemacs.machine-local -> machine-local.el"
ln_s(machine_config, dot_machine)
end
task :touch => [dot_custom, machine_config]
task :link => [:touch, master_checkout, dot_emacs, dot_spacemacs, dot_machine]
task :check do
if `which emacs`.empty?
raise "Install the latest version of Emacs before continuing."
end
end
end
task :default => ['spacemacs:check', 'spacemacs:link']