Browse files

basic check functionality

  • Loading branch information...
1 parent a55a2e4 commit 386a2d2a3a9ebdf8f08c267c5381c0c3b21e0b46 @schacon schacon committed Feb 16, 2011
Showing with 32 additions and 1 deletion.
  1. +32 −1 lib/git-scribe.rb
View
33 lib/git-scribe.rb
@@ -46,7 +46,38 @@ def init
# check that we have everything needed
def check
- # look for a2x (asciidoc, latex, xsltproc)
+ # check for asciidoc
+ if !check_can_run('asciidoc')
+ puts "asciidoc is not present, please install it for anything to work"
+ else
+ puts "asciidoc - ok"
+ end
+
+ # check for xsltproc
+ if !check_can_run('xsltproc --version')
+ puts "xsltproc is not present, please install it for html generation"
+ else
+ puts "xsltproc - ok"
+ end
+
+ # check for a2x - should be installed with asciidoc, but you never know
+ if !check_can_run('a2x')
+ puts "a2x is not present, please install it for epub generation"
+ else
+ puts "a2x - ok"
+ end
+
+ # check for fop
+ if !check_can_run('fop -version')
+ puts "fop is not present, please install for PDF generation"
+ else
+ puts "fop - ok"
+ end
+ end
+
+ def check_can_run(command)
+ `#{command} 2>&1`
+ $?.exitstatus == 0
end
BOOK_FILE = 'book.asc'

0 comments on commit 386a2d2

Please sign in to comment.