Skip to content

Commit

Permalink
fix(ci): us os_tmpdir intead of /tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Jan 2, 2024
1 parent 261d555 commit 2dc27a1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/minimal_init.lua
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 2dc27a1

Please sign in to comment.