Rakefile in flatpickr-4.6.3.0 vs Rakefile in flatpickr-4.6.3.1
- old
+ new
@@ -11,33 +11,32 @@
namespace :flatpickr do
namespace :assets do
desc 'Update Flatpickr assets from source.'
task update: :clean do
version = ARGV[1] || "v#{Flatpickr::VERSION.sub(/.\d+$/, '')}"
+ source_dir = 'node_modules/flatpickr'
- sh 'git clone git@github.com:flatpickr/flatpickr.git flatpickr_source'
- sh "cd flatpickr_source && git checkout tags/#{version}"
- sh 'cd flatpickr_source && npm install && npm run build:pre && npm run build:build'
+ sh "npm install flatpickr@#{version}"
- sh 'cp flatpickr_source/dist/flatpickr.js vendor/assets/javascripts/flatpickr.js'
- sh 'cp -R flatpickr_source/dist/plugins/ vendor/assets/javascripts/flatpickr/plugins/'
- sh 'cd vendor/assets/javascripts/flatpickr/plugins/ && find . -name "*.css" -type f -delete'
- sh 'cp -R flatpickr_source/dist/l10n/ vendor/assets/javascripts/flatpickr/l10n/'
+ sh "cp #{source_dir}/dist/flatpickr.js vendor/assets/javascripts/flatpickr.js"
+ sh "cp -R #{source_dir}/dist/plugins/ vendor/assets/javascripts/flatpickr/plugins/"
+ sh "cp -R #{source_dir}/dist/l10n/ vendor/assets/javascripts/flatpickr/l10n/"
+ sh 'cd vendor/assets/javascripts/flatpickr/ && find . -not -name "*.js" -type f -delete'
- sh 'cp flatpickr_source/dist/flatpickr.css vendor/assets/stylesheets/flatpickr.css'
- sh 'cp -R flatpickr_source/dist/plugins/ vendor/assets/stylesheets/flatpickr/plugins/'
- sh 'cd vendor/assets/stylesheets/flatpickr/plugins/ && find . -name "*.js" -type f -delete'
- sh 'cp -R flatpickr_source/dist/themes/ vendor/assets/stylesheets/flatpickr/themes/'
- sh 'cp flatpickr_source/dist/ie.css vendor/assets/stylesheets/flatpickr/ie.css'
+ sh "cp #{source_dir}/dist/flatpickr.css vendor/assets/stylesheets/flatpickr.css"
+ sh "cp -R #{source_dir}/dist/plugins/ vendor/assets/stylesheets/flatpickr/plugins/"
+ sh "cp -R #{source_dir}/dist/themes/ vendor/assets/stylesheets/flatpickr/themes/"
+ sh "cp #{source_dir}/dist/ie.css vendor/assets/stylesheets/flatpickr/ie.css"
+ sh 'cd vendor/assets/stylesheets/flatpickr/ && find . -not -name "*.css" -type f -delete'
- puts "\n===============================\n"
- puts "ASSETS UPDATED to #{version}! ✨"
+ puts "\n================================"
+ puts "* ASSETS UPDATED to #{version}! 🔧 *"
+ puts "================================"
end
desc 'Remove previous Flatpickr assets.'
task :clean do
sh 'rm -rf vendor'
- sh 'rm -rf flatpickr_source'
sh 'mkdir -p vendor/assets/stylesheets/flatpickr/'
sh 'mkdir -p vendor/assets/javascripts/flatpickr/'
end
end
end