From 31f0b9d39c9c8811483713b5e2ebcbb3434dc99c Mon Sep 17 00:00:00 2001 From: Oleksandr Smirnov Date: Mon, 24 Feb 2025 13:21:53 +0200 Subject: [PATCH] refactor: if base dir specified in the env, then it will be used --- .envrc | 3 +++ .gitignore | 1 + spec/testutils.lua | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..dd6cca9 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +dotenv + +env_vars_required GOPHER_DIR diff --git a/.gitignore b/.gitignore index df7d859..3a9d44e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /playground/ /.tests/ +/.env diff --git a/spec/testutils.lua b/spec/testutils.lua index 177b9a1..64e0f9d 100644 --- a/spec/testutils.lua +++ b/spec/testutils.lua @@ -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