fix: changes for file paths
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
-- lua/chatgpt_nvim/config.lua
|
||||
-- Changed to use YAML for configuration instead of JSON.
|
||||
-- Reads from .chatgpt_config.yaml and uses lyaml to parse it.
|
||||
-- If no config file is found, uses default values.
|
||||
|
||||
local M = {}
|
||||
local uv = vim.loop
|
||||
|
||||
-- Attempt to require lyaml for YAML parsing.
|
||||
-- Make sure lyaml is installed (e.g., via luarocks install lyaml)
|
||||
local ok_yaml, lyaml = pcall(require, "lyaml")
|
||||
|
||||
local function get_config_path()
|
||||
@@ -18,9 +11,8 @@ end
|
||||
|
||||
function M.load()
|
||||
local path = get_config_path()
|
||||
local fd = uv.fs_open(path, "r", 438) -- 438 = 0o666
|
||||
local fd = uv.fs_open(path, "r", 438)
|
||||
if not fd then
|
||||
-- Return some default configuration if no file found
|
||||
return {
|
||||
initial_prompt = "",
|
||||
directories = { "." },
|
||||
@@ -41,7 +33,6 @@ function M.load()
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Fallback if decode fails
|
||||
return {
|
||||
initial_prompt = "",
|
||||
directories = { "." },
|
||||
|
||||
Reference in New Issue
Block a user