refactor: if base dir specified in the env, then it will be used

This commit is contained in:
Oleksandr Smirnov 2025-02-24 13:21:53 +02:00
parent 1939f3af3d
commit 31f0b9d39c
No known key found for this signature in database
3 changed files with 5 additions and 2 deletions

3
.envrc Normal file
View file

@ -0,0 +1,3 @@
dotenv
env_vars_required GOPHER_DIR

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/playground/
/.tests/
/.env

View file

@ -1,5 +1,4 @@
-- NOTE: there's a probably a better way to do this
local base_dir = vim.fn.expand "%:p:h"
local base_dir = vim.env.GOPHER_DIR or vim.fn.expand "%:p:h"
local fixtures_dir = vim.fs.joinpath(base_dir, "/spec/fixtures/")
---@class gopher.TestUtils