refactor: fixed deprecated write_file to use table instead of string for
each language in templates.projects
This commit is contained in:
+15
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user