aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-02-15 09:47:52 -0500
committerGitHub <noreply@github.com>2023-02-15 22:47:52 +0800
commit581b96352e1c98a35511555f1ba57c152a5df31f (patch)
tree110b59ccd4baf64bebe2bc3d37ba3fccfc3bc6c9 /scripts
parentfix(lspinfo): normalize fname path correctly (#2343) (diff)
downloadnvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.tar
nvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.tar.gz
nvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.tar.bz2
nvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.tar.lz
nvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.tar.xz
nvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.tar.zst
nvim-lspconfig-581b96352e1c98a35511555f1ba57c152a5df31f.zip
docs: make sure username doesn't leak into generated document (#2441)
* docs: make sure username doesn't leak into generated document The documents previously contained `runner`, the username of GitHub Actions runners, which would be overwritten by the user's name when run locally and generate unwanted diff. * docs: rename username to user Co-authored-by: Justin M. Keyes <justinkz@gmail.com> --------- Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/docgen.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/docgen.lua b/scripts/docgen.lua
index 93d57eb0..119353ba 100644
--- a/scripts/docgen.lua
+++ b/scripts/docgen.lua
@@ -82,11 +82,21 @@ require'lspconfig'.{{template_name}}.setup{}
]]
local function require_all_configs()
+ -- Make sure username doesn't leak into the generated document
+ local old_home = vim.env.HOME
+ local old_cache_home = vim.env.XDG_CACHE_HOME
+ vim.env.HOME = '/home/user'
+ vim.env.XDG_CACHE_HOME = '/home/user/.cache'
+
-- Configs are lazy-loaded, tickle them to populate the `configs` singleton.
for _, v in ipairs(vim.fn.glob('lua/lspconfig/server_configurations/*.lua', 1, 1)) do
local module_name = v:gsub('.*/', ''):gsub('%.lua$', '')
configs[module_name] = require('lspconfig.server_configurations.' .. module_name)
end
+
+ -- Reset the environment variables
+ vim.env.HOME = old_home
+ vim.env.XDG_CACHE_HOME = old_cache_home
end
local function make_lsp_sections()