#!/usr/bin/python

import fnmatch
import os

matches = []
for root, dirnames, filenames in os.walk('./'):
  for filename in fnmatch.filter(filenames, '*.js'):
      matches.append(os.path.join(root, filename))
print matches

from subprocess import call
	
for match in matches:
	import os
	cmd = 'js2coffee ' + match + ' > ' + ".".join([x for x in match.split('.')[:-1]])+".coffee";
	print cmd
	os.system(cmd);