Browse Source

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

* fix(config): copy the correct example config

* refactor: don't check if dir exists
LostNeophyte 2 years ago
parent
commit
f590770a17
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lua/lvim/config/init.lua

+ 3 - 1
lua/lvim/config/init.lua

@@ -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