issue #195: user-specific tempdir for expanding template modules

This commit is contained in:
Steve Donovan 2016-06-27 12:20:20 +02:00
parent dadad3f737
commit 2f71eabd9f
1 changed files with 2 additions and 1 deletions

View File

@ -774,7 +774,8 @@ end
local builtin_style, builtin_template = match_bang(args.style),match_bang(args.template)
if builtin_style or builtin_template then
-- '!' here means 'use built-in templates'
local tmpdir = path.join(path.is_windows and os.getenv('TMP') or '/tmp','ldoc')
local user = path.expanduser('~'):gsub('[/\\ ]','_')
local tmpdir = path.join(path.is_windows and os.getenv('TMP') or '/tmp','ldoc'..user)
if not path.isdir(tmpdir) then
lfs.mkdir(tmpdir)
end