Created
January 15, 2013 23:56
-
-
Save pmeinhardt/4543330 to your computer and use it in GitHub Desktop.
ruby wrapper script for google closure compiler
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 | |
begin | |
require 'closure-compiler' | |
rescue LoadError => e | |
puts e.message | |
puts "to fix: gem install 'closure-compiler'" | |
exit 1 | |
end | |
if ARGV.count != 1 | |
puts "usage: #{File.basename($0)} <path>" | |
exit 0 | |
end | |
path = ARGV.first | |
unless File.exists?(path) | |
puts "file not found: #{path}" | |
exit 1 | |
end | |
compiler = Closure::Compiler.new | |
puts compiler.compile(File.open(path)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment