From 2dc27a1dd832bfda6e7a139214491a56be9eb755 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Tue, 2 Jan 2024 12:06:02 -0800 Subject: [PATCH] fix(ci): us os_tmpdir intead of /tmp --- tests/minimal_init.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/minimal_init.lua b/tests/minimal_init.lua index ce65ccb..58d50a3 100644 --- a/tests/minimal_init.lua +++ b/tests/minimal_init.lua @@ -1,7 +1,11 @@ local M = {} +local function tempdir(plugin) + return vim.loop.os_tmpdir() .. "/" .. plugin +end + function M.loadLazy() - local lazy_dir = os.getenv("LAZY_DIR") or "/tmp/lazy.nvim" + local lazy_dir = os.getenv("LAZY_DIR") or tempdir("lazy.nvim") if vim.fn.isdirectory(lazy_dir) == 0 then vim.fn.system({ "git", @@ -17,7 +21,7 @@ function M.loadLazy() end function M.loadWhichKey() - local whichkey_dir = os.getenv("WHICHKEY_DIR") or "/tmp/which-key.nvim" + local whichkey_dir = os.getenv("WHICHKEY_DIR") or tempdir("which-key.nvim") if vim.fn.isdirectory(whichkey_dir) == 0 then vim.fn.system({ "git", @@ -32,9 +36,9 @@ function M.loadWhichKey() require("which-key").setup({}) end -local plenary_dir = os.getenv("PLENARY_DIR") or "/tmp/plenary.nvim" -local treesitter_dir = os.getenv("TREESITTER_DIR") or "/tmp/nvim-treesitter" -local mini_dir = os.getenv("MINI_DIR") or "/tmp/mini-test" +local plenary_dir = os.getenv("PLENARY_DIR") or tempdir("plenary.nvim") +local treesitter_dir = os.getenv("TREESITTER_DIR") or tempdir("nvim-treesitter") +local mini_dir = os.getenv("MINI_DIR") or tempdir("mini-test") if vim.fn.isdirectory(plenary_dir) == 0 then vim.fn.system({ "git",