Skip to content

Commit 4b73b51

Browse files
committed
Update Rakefile to use a locally installed version of jison
The means root access is no longer required to build.
1 parent 89f5ab8 commit 4b73b51

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ lib/handlebars/compiler/parser.js
66
node_modules
77
*.sublime-project
88
*.sublime-workspace
9+
npm-debug.log

Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require "rubygems"
22
require "bundler/setup"
33

44
def compile_parser
5-
system "jison src/handlebars.yy src/handlebars.l"
5+
system "./node_modules/jison/lib/jison/cli-wrapper.js src/handlebars.yy src/handlebars.l"
66
if $?.success?
77
File.open("lib/handlebars/compiler/parser.js", "w") do |file|
88
file.puts File.read("handlebars.js") + ";"
@@ -15,11 +15,11 @@ def compile_parser
1515
end
1616

1717
file "lib/handlebars/compiler/parser.js" => ["src/handlebars.yy","src/handlebars.l"] do
18-
if ENV['PATH'].split(':').any? {|folder| File.exists?(folder+'/jison')}
18+
if File.exists?('./node_modules/jison/lib/jison/cli-wrapper.js')
1919
compile_parser
2020
else
2121
puts "Jison is not installed. Trying `npm install jison`."
22-
sh "npm install jison -g"
22+
sh "npm install jison"
2323
compile_parser
2424
end
2525
end

0 commit comments

Comments
 (0)