Checks to see if jison is installed before attempting to run it in Rakefile

This commit is contained in:
Bryan Woods
2011-02-13 12:37:08 -05:00
parent d7f93c09e7
commit 76e1bb4c06
+6 -2
View File
@@ -2,8 +2,12 @@ require "rubygems"
require "bundler/setup"
file "lib/handlebars/parser.js" => ["src/handlebars.yy","src/handlebars.l"] do
system "jison src/handlebars.yy src/handlebars.l"
sh "mv handlebars.js lib/handlebars/parser.js"
if ENV['PATH'].split(':').any? {|folder| File.exists?(folder+'/jison')}
system "jison src/handlebars.yy src/handlebars.l"
sh "mv handlebars.js lib/handlebars/parser.js"
else
puts "Jison is not installed. Try running `npm install jison`."
end
end
task :compile => "lib/handlebars/parser.js"