Created
June 7, 2012 14:55
-
-
Save joeyrobert/2889227 to your computer and use it in GitHub Desktop.
beautify javascript directory
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
#!/usr/bin/env ruby | |
if ARGV[0] | |
Dir.glob(ARGV[0]+"**/*.js").each do |file| | |
puts "Beautifying JS file: #{file}" | |
puts `js-beautify -s 2 -j -o "#{file}.pretty" "#{file}"` | |
puts `mv "#{file}.pretty" #{file}` | |
end | |
else | |
puts "Usage: #{__FILE__} directory" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment