-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
48 lines (40 loc) · 1.08 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
require 'English'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
CONFIG_DIR = "#{ENV['HOME']}/.config/nautilus".freeze
SCRIPTS_DIR = "#{ENV['HOME']}/.local/share/nautilus/scripts".freeze
SCRIPTS = FileList['scripts/*']
REQUIREMENTS = %w[xdotool nautilus zenity].freeze
task default: 'spec'
desc 'Install'
task 'install' => %w[check install_scripts install_config install_accels] do
puts 'Done'
end
desc 'Check reqruirements'
task 'check' do
puts 'Checking requirements'
REQUIREMENTS.each do |bin|
`which #{bin}`
if $CHILD_STATUS.success?
puts "#{bin}: OK"
else
abort "#{bin}: Not Found. please install #{bin}."
end
end
end
desc 'Install scripts'
task 'install_scripts' do
puts 'Installing'
SCRIPTS.each do |script|
install script, File.join(SCRIPTS_DIR, File.basename(script, '.rb')),
mode: 0o755
end
end
desc 'Install config'
task 'install_config' do
install 'save_tabs', CONFIG_DIR if File.exist?('save_tabs')
end
desc 'Install accels'
task 'install_accels' do
install 'scripts-accels', "#{CONFIG_DIR}/scripts-accels"
end