forked from ivyl/gedit-mate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
35 lines (31 loc) · 1005 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
if RUBY_VERSION < "1.9"
require 'ftools'
else
require 'fileutils'
end
include FileUtils
GEDIT = File.join ENV['HOME'], '.local/share/gedit/'
namespace :install do
desc 'install snippets, plugins and styles locally'
task :local do
mkdir_p GEDIT
%w(plugins snippets styles).each do |dir|
cp_r dir, GEDIT
end
# Create link in .config (since some distributions still uses this)
ln_s GEDIT, File.join(ENV['HOME'], '.config/')
end
desc 'install lang-specs, mime types and \'g\', command needs root priviliges'
task :global do
Dir.glob("mime/*.xml") do |file|
# Copy all files except rst.xml, it doesn't seem to be valid.
cp file, '/usr/share/mime/packages/' unless file == 'mime/rst.xml'
end
Dir.glob("lang-specs/*.lang") do |file|
cp file, '/usr/share/gtksourceview-3.0/language-specs/'
end
cp 'bin/g', '/usr/bin/g'
chmod 0755, '/usr/bin/g', :verbose => true
print `update-mime-database /usr/share/mime`
end
end