[#262] Add a rake task to convert line endings to UNIX
This commit is contained in:
parent
bc249871a6
commit
05a4c4616f
|
@ -0,0 +1,14 @@
|
||||||
|
namespace :code do
|
||||||
|
desc "Fix line endings of all source files"
|
||||||
|
task :fix_line_endings do
|
||||||
|
unless `which fromdos`.present?
|
||||||
|
raise "fromdos command not found"
|
||||||
|
end
|
||||||
|
|
||||||
|
Dir['**/**{.rb,.html.erb,.rhtml,.rjs,.rsb,.plain.erb,.rxml,.yml,.rake,.eml}'].each do |file_name|
|
||||||
|
next if file_name.include?("vendor")
|
||||||
|
system("fromdos #{file_name}")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue