fix(config): copy the correct example config (#3722)

* fix(config): copy the correct example config

* refactor: don't check if dir exists
This commit is contained in:
LostNeophyte 2023-01-13 13:39:11 +01:00 committed by GitHub
parent 8cc1cc6206
commit f590770a17
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,7 +56,9 @@ function M:load(config_path)
vim.notify_once(
string.format("User-configuration not found. Creating an example configuration in %s", config_path)
)
local example_config = join_paths(get_lvim_base_dir(), "utils", "installer", "config.example.lua")
local config_name = vim.loop.os_uname().version:match "Windows" and "config_win" or "config"
local example_config = join_paths(get_lvim_base_dir(), "utils", "installer", config_name .. ".example.lua")
vim.fn.mkdir(user_config_dir, "p")
vim.loop.fs_copyfile(example_config, config_path)
end
end