#coding: utf-8

require "find"

Find.find(File.dirname(__FILE__)) do |f|
	if [".js", ".py"].any?{|i| f.end_with? i} and not f.include? __FILE__
		str = File.read(f)
		strdup = str.dup
		while str =~ /(\n[\s\t]*)    /
			str.gsub!(/(\n[\s\t]*)    /, "\\1\t")
		end
		File.open(f, "w").write(str)
		if str != strdup
			puts "CHANGED FILE: #{f}"
		end
	end
end