Skip to content

Instantly share code, notes, and snippets.

@aishek
Created November 7, 2012 17:30
Show Gist options
  • Save aishek/4033090 to your computer and use it in GitHub Desktop.
Save aishek/4033090 to your computer and use it in GitHub Desktop.
piece of cake to convert crlftolf
task 'crlftolf', '', ->
execFile(
'find'
["#{__dirname}/www"]
(err, stdout, stderr) ->
file_list = stdout.split('\n')
for file in file_list
if file
stats = fs.lstatSync(file)
unless stats.isDirectory()
tempfile = "#{file}.temp"
exec "cat #{file} | tr -d $'\r' > #{tempfile}; rm #{file}; mv #{tempfile} #{file}", {}
process.stdout.write("#{file}\n")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment