diff options
Diffstat (limited to 'lua/99/utils.lua')
| -rw-r--r-- | lua/99/utils.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lua/99/utils.lua b/lua/99/utils.lua index c308624..0882489 100644 --- a/lua/99/utils.lua +++ b/lua/99/utils.lua @@ -3,12 +3,9 @@ local M = {} --- directories. if this is still the case in neovim land, then we will need --- to make the _99_state have the project directory. --- @return string -function M.random_file() - return string.format( - "%s/tmp/99-%d", - vim.uv.cwd(), - math.floor(math.random() * 10000) - ) +function M.random_file(dir) + local directory = dir or (vim.uv.cwd() .. "/tmp") + return string.format("%s/99-%d", directory, math.floor(math.random() * 10000)) end return M |
