forked from jschoolcraft/Limechat-Themes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
65 lines (57 loc) · 2.14 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
namespace :themes do
desc 'Create symlinks for all of the themes in the current directory'
task :linkup do
%x[git submodule init && git submodule update]
puts "updates done. linkup starting"
#for some reason this is barfing on the css files. try it later
Dir.glob("#{File.dirname(__FILE__)}/**/*.css") { |css|
newcss = File.basename(css)
FileUtils.ln_s css, newcss, :force => true
}
Dir.glob("#{File.dirname(__FILE__)}/**/*.yaml") { |yaml|
newyaml = File.basename(yaml)
FileUtils.ln_s yaml, newyaml, :force => true
}
Dir.glob("#{File.dirname(__FILE__)}/**/*.js") { |js|
newjs = File.basename(js)
FileUtils.ln_s js, newjs, :force => true
}
end
desc 'Install into the logged in user\'s limechat directory'
task :install do
puts "Starting updates"
%x[git submodule init && git submodule update]
puts "Moving Files"
source = Dir.getwd + "/."
Dir.chdir
app_support_base = Dir.getwd + '/Library/Application Support'
target = app_support_base + '/net.limechat.LimeChat-AppStore/Themes/' # app store installation dir
unless File.directory?(target)
target = app_support_base + '/LimeChat/Themes/'
end
FileUtils.cp_r(source, target, :remove_destination => true)
puts "Setting up Symlinks"
puts "Installing themes into #{target}"
Dir.chdir(target)
Dir.glob("#{File.dirname(__FILE__)}/**/*.css") { |css|
newcss = File.basename(css)
FileUtils.ln_s css, newcss, :force => true
}
Dir.glob("#{File.dirname(__FILE__)}/**/*.yaml") { |yaml|
newyaml = File.basename(yaml)
FileUtils.ln_s yaml, newyaml, :force => true
}
Dir.glob("#{File.dirname(__FILE__)}/**/*.js") { |js|
newjs = File.basename(js)
FileUtils.ln_s js, newjs, :force => true
}
end
desc 'Initalize the directory, loading the submodules'
task :init do
%x[git submodule init && git submodule update]
end
desc 'Update the themes directory'
task :update do
%x[git pull && git submodule init && git submodule update]
end
end