Skip to content

Commit 1a0154b

Browse files
feat: warn user if invalid userconfig path was provided
1 parent 24b08bc commit 1a0154b

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

flake.nix

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,19 @@
8181
FROSTY_PACKAGES="${packageList}"
8282
FROSTY_RUNTIMEPATHS={"${./.}", "${builtins.concatStringsSep "," treesitterParsers}"}
8383
${lib.optionalString allowUserConfigEnvVar ''
84-
local stat = vim.uv.fs_stat(vim.env.FROSTY_USERCONFIG or "")
85-
if stat and stat.type == "file" then
86-
FROSTY_USERCONFIG = dofile(vim.env.FROSTY_USERCONFIG)
84+
if vim.env.FROSTY_USERCONFIG then
85+
local stat = vim.uv.fs_stat(vim.env.FROSTY_USERCONFIG)
86+
if stat and stat.type == "file" then
87+
FROSTY_USERCONFIG = dofile(vim.env.FROSTY_USERCONFIG)
88+
else
89+
vim.schedule(function()
90+
vim.notify(
91+
"FROSTY_USERCONFIG was provided, but it wasn't a valid file path",
92+
vim.log.levels.WARN,
93+
{ title = "Frosty" }
94+
)
95+
end)
96+
end
8797
end''}
8898
dofile("${./.}/init.lua")
8999
'';

0 commit comments

Comments
 (0)