refactor: fixed deprecated write_file to use table instead of string for

each language in templates.projects
This commit is contained in:
DarthMooMancer
2025-05-12 00:41:05 -04:00
parent 677e5bbc67
commit 4ecaf54f82
7 changed files with 103 additions and 106 deletions
+15 -2
View File
@@ -7,8 +7,21 @@ function M.setup(opts)
end
function M.is_dir(path)
local stat = vim.loop.fs_stat(path)
return stat and stat.type == "directory"
local stat = vim.loop.fs_stat(path)
return stat and stat.type == "directory"
end
function M.get_project_root()
-- Get absolute path to this Lua file (or any file in your plugin)
local plugin_path = debug.getinfo(1, "S").source:sub(2)
local plugin_dir = vim.fn.fnamemodify(plugin_path, ":h:h:h")
-- Build the full path to your script
local script_path = plugin_dir .. "/bash_scripts/walkup.sh"
-- Run the script and get output
local dir = vim.fn.system(script_path):gsub("%s+$", "")
return dir
end
function M.write_file(path_segments, content)