Skip to content

Commit

Permalink
Added checks for binaries used to generate the pdf man pages
Browse files Browse the repository at this point in the history
  • Loading branch information
wpferguson committed Oct 24, 2016
1 parent 564fd20 commit 4fccfbf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/get_lib_manpages.lua
Expand Up @@ -6,6 +6,7 @@

local dt = require "darktable"
local du = require "lib/dtutils"
local df = require "lib/dtutils.file"
local log = require "lib/dtutils.log"
local libname = nil

Expand All @@ -30,7 +31,15 @@ local function output_man(d)
end
end
mf:close()
os.execute("groff -man " .. fname .. " | ps2pdf - " .. fname .. ".pdf")
if df.check_if_bin_exists("groff") then
if df.check_if_bin_exists("ps2pdf") then
os.execute("groff -man " .. fname .. " | ps2pdf - " .. fname .. ".pdf")
else
log.msg(log.error, "Missing ps2pdf. Can't generate pdf man pages.")
end
else
log.msg(log.error, "Missing groff. Can't generate pdf man pages.")
end
else
log.msg(log.error, "Can't open file " .. fname .. "for writing")
end
Expand Down

0 comments on commit 4fccfbf

Please sign in to comment.