summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2016-01-05 02:04:10 -0700
committerDan Allen <dan.j.allen@gmail.com>2016-01-05 02:04:10 -0700
commit83e69bdb9663a6933db512595d36a477d986f6d0 (patch)
tree12797f9fb2104245561c432f9bbe3bef878b4b7d /bin
parenta5545ae3646b714c10ea23d008a9c8786f5b2d25 (diff)
use failproof relative require logic in bin script
Diffstat (limited to 'bin')
-rwxr-xr-xbin/asciidoctor-pdf6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/asciidoctor-pdf b/bin/asciidoctor-pdf
index 083860bc..6649aaf7 100755
--- a/bin/asciidoctor-pdf
+++ b/bin/asciidoctor-pdf
@@ -1,6 +1,10 @@
#!/usr/bin/env ruby
-require_relative '../lib/asciidoctor-pdf'
+if File.exist?(asciidoctor_pdf = (File.expand_path '../../lib/asciidoctor-pdf', __FILE__))
+ require asciidoctor_pdf
+else
+ require 'asciidoctor-pdf'
+end
require 'asciidoctor/cli'
options = Asciidoctor::Cli::Options.new backend: 'pdf', header_footer: true