diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 7f84a4d54d..5575de5b36 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -1089,7 +1089,7 @@ end --- @returns info dict function M.gen(help_dir, to_dir, include, commit, parser_path) vim.validate{ - help_dir={help_dir, function(d) return vim.fn.isdirectory(d) == 1 end, 'valid directory'}, + help_dir={help_dir, function(d) return vim.fn.isdirectory(vim.fn.expand(d)) == 1 end, 'valid directory'}, to_dir={to_dir, 's'}, include={include, 't', true}, commit={commit, 's', true}, @@ -1098,8 +1098,9 @@ function M.gen(help_dir, to_dir, include, commit, parser_path) local err_count = 0 ensure_runtimepath() - tagmap = get_helptags(help_dir) + tagmap = get_helptags(vim.fn.expand(help_dir)) helpfiles = get_helpfiles(include) + to_dir = vim.fn.expand(to_dir) parser_path = parser_path and vim.fn.expand(parser_path) or nil print(('output dir: %s'):format(to_dir)) @@ -1134,14 +1135,14 @@ end -- @returns results dict function M.validate(help_dir, include, parser_path) vim.validate{ - help_dir={help_dir, function(d) return vim.fn.isdirectory(d) == 1 end, 'valid directory'}, + help_dir={help_dir, function(d) return vim.fn.isdirectory(vim.fn.expand(d)) == 1 end, 'valid directory'}, include={include, 't', true}, parser_path={parser_path, function(f) return f == nil or vim.fn.filereadable(vim.fn.expand(f)) == 1 end, 'valid vimdoc.{so,dll} filepath'}, } local err_count = 0 local files_to_errors = {} ensure_runtimepath() - tagmap = get_helptags(help_dir) + tagmap = get_helptags(vim.fn.expand(help_dir)) helpfiles = get_helpfiles(include) parser_path = parser_path and vim.fn.expand(parser_path) or nil