-
Notifications
You must be signed in to change notification settings - Fork 35
/
Rakefile
38 lines (30 loc) · 1.03 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
#!/usr/bin/env rake
require "bundler/gem_tasks"
task :submodule do
sh 'git submodule update --init' unless File.exist?('bootstrap-datetimepicker/README.md')
end
desc "Remove the vendor directory"
task :clean do
rm_rf 'vendor'
end
desc "Generate the JavaScript assets"
task javascripts: :submodule do
target_dir = "vendor/assets/javascripts"
FileUtils.mkdir_p target_dir
Rake.rake_output_message 'Generating javascripts'
FileUtils.cp_r Dir["bootstrap-datetimepicker/src/js/*"], "vendor/assets/javascripts"
end
desc "Generate the CSS assets"
task stylesheets: :submodule do
target_dir = "vendor/assets/stylesheets"
mkdir_p target_dir
Rake.rake_output_message 'Generating stylesheets'
FileUtils.cp_r Dir["bootstrap-datetimepicker/build/css/*"], "vendor/assets/stylesheets"
Dir["vendor/assets/stylesheets/*"].each do |file|
FileUtils.mv(file, file.gsub("min.css", "css"))
end
end
desc "Clean and then generate everything (default)"
task assets: [:clean, :javascripts, :stylesheets]
task build: :assets
task default: :assets