Skip to content

Commit 4fccfbf

Browse files
committed
Added checks for binaries used to generate the pdf man pages
1 parent 564fd20 commit 4fccfbf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/get_lib_manpages.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
local dt = require "darktable"
88
local du = require "lib/dtutils"
9+
local df = require "lib/dtutils.file"
910
local log = require "lib/dtutils.log"
1011
local libname = nil
1112

@@ -30,7 +31,15 @@ local function output_man(d)
3031
end
3132
end
3233
mf:close()
33-
os.execute("groff -man " .. fname .. " | ps2pdf - " .. fname .. ".pdf")
34+
if df.check_if_bin_exists("groff") then
35+
if df.check_if_bin_exists("ps2pdf") then
36+
os.execute("groff -man " .. fname .. " | ps2pdf - " .. fname .. ".pdf")
37+
else
38+
log.msg(log.error, "Missing ps2pdf. Can't generate pdf man pages.")
39+
end
40+
else
41+
log.msg(log.error, "Missing groff. Can't generate pdf man pages.")
42+
end
3443
else
3544
log.msg(log.error, "Can't open file " .. fname .. "for writing")
3645
end

0 commit comments

Comments
 (0)