forked from carlosgaldino/alfred-emoji-workflow
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
48 lines (42 loc) · 1017 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
45
46
47
48
require 'pathname'
require 'shellwords'
RootDir = Pathname.new(Rake.application.original_dir)
DestDir = Pathname.new(Rake.application.original_dir + '-pristine')
BuildDir = RootDir.join('build')
desc 'Copy necessary files to new bundle'
task :default do
rm_rf DestDir
mkdir_p DestDir
rm_rf BuildDir
mkdir_p BuildDir
[
'emoji.rb',
'icon.png',
'emoji-db/emoji-db.json',
'emoji-db/images/',
].each do |f|
dir_name = File.dirname(f)
mkdir_p(DestDir.join dir_name) if dir_name != '.'
cp_r RootDir.join(f), DestDir.join(f)
end
plist_contents = File.read(RootDir.join('info.plist'))
File.open(DestDir.join('info.plist'), 'w', 0644) do |f|
f.write plist_contents.gsub(
'Find Dat Emoji DEV',
'Find Dat Emoji'
).gsub(
'testmoji',
'emoji'
).gsub(
'fm.meyer.FindDatEmojiDev',
'fm.meyer.FindDatEmoji'
)
end
chdir DestDir
system(
'zip',
'-r9',
BuildDir.join('find-emoji.alfredworkflow').to_s,
'.'
)
end