Last active
December 1, 2015 14:04
-
-
Save mattm/ffa3bb917e377caf4cfd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :lint do | |
task run: :environment do | |
js_dir = "#{Rails.root}/app/assets/javascripts" | |
Dir.chdir(js_dir) | |
# No directories and no application.js | |
files = Dir.glob('*').delete_if{ |f| File.directory?(f) || f == 'application.js' } | |
files.each do |file| | |
puts file | |
# There is a likely way to do this with Rake::Task's `invoke` and `reenable` methods | |
# but I couldn't figure out how to get it to check more than the first file. | |
puts `rake eslint:run[#{js_dir}/#{file}]` | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment