From 8bc3700377043c433d61358644b9490bffe5aafd Mon Sep 17 00:00:00 2001 From: mpeterv Date: Thu, 4 Feb 2016 13:38:22 +0300 Subject: [PATCH] Use dir.makepath when creating output directory Don't exit with error if an intermediate directory doesn't exist. Also, handle directory creation failure. --- ldoc/tools.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ldoc/tools.lua b/ldoc/tools.lua index d311f70..947d207 100644 --- a/ldoc/tools.lua +++ b/ldoc/tools.lua @@ -14,7 +14,6 @@ local M = tools local append = table.insert local lexer = require 'ldoc.lexer' local quit = utils.quit -local lfs = require 'lfs' -- at rendering time, can access the ldoc table from any module item, -- or the item itself if it's a module @@ -225,7 +224,9 @@ end function M.check_directory(d) if not path.isdir(d) then - lfs.mkdir(d) + if not dir.makepath(d) then + quit("Could not create "..d.." directory") + end end end