Honor the TMPDIR environment variable (#266)
When creating a temporary directory, use $TMPDIR as base directory if set, otherwise fall back to "/tmp".
This commit is contained in:
parent
b08024b592
commit
e6e6a79e19
2
ldoc.lua
2
ldoc.lua
|
@ -791,7 +791,7 @@ local builtin_style, builtin_template = match_bang(args.style),match_bang(args.t
|
|||
if builtin_style or builtin_template then
|
||||
-- '!' here means 'use built-in templates'
|
||||
local user = path.expanduser('~'):gsub('[/\\: ]','_')
|
||||
local tmpdir = path.join(path.is_windows and os.getenv('TMP') or '/tmp','ldoc'..user)
|
||||
local tmpdir = path.join(path.is_windows and os.getenv('TMP') or (os.getenv('TMPDIR') or '/tmp'),'ldoc'..user)
|
||||
if not path.isdir(tmpdir) then
|
||||
lfs.mkdir(tmpdir)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue