Skip to content

Commit

Permalink
Add wkhtmltopdf start script
Browse files Browse the repository at this point in the history
  • Loading branch information
bradphelan committed Sep 26, 2011
1 parent 98d727d commit 9e58648
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/wkhtmltopdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/ruby


if RUBY_PLATFORM =~ /x86_64-linux/
executable = 'wkhtmltopdf-linux-amd64'
elsif RUBY_PLATFORM =~ /darwin/
raise "Invalid platform. Must be running linux amd x64"
end

arguments = $*.map { |x| x.include?(' ') ? "'" + x + "'" : x }

executable = File.join(File.dirname(__FILE__), executable)
r = system(executable + " " + arguments.join(" "))

exit r ? 0 : 1

0 comments on commit 9e58648

Please sign in to comment.