forked from c4lliope/datetime_picker_rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
32 lines (27 loc) · 1013 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
require "bundler/gem_tasks"
task :submodule do
sh 'git submodule update --init' unless File.exist?('bootstrap-datetimepicker/README.md')
end
desc 'Clean the vendor directory'
task clean: :submodule do
Rake.rake_output_message 'Cleaning up the vendor directory.'
FileUtils.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/*'], target_dir
FileUtils.cp_r Dir['bootstrap-datetimepicker/build/js/*'], target_dir
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 Dir['bootstrap-datetimepicker/build/css/*'], target_dir
end
desc 'Clean and then generate everything'
task assets: [:clean, :javascripts, :stylesheets]
task default: :assets