15 lines
334 B
Lua
15 lines
334 B
Lua
local utils = require("new-file-template.utils")
|
|
|
|
return function(opts)
|
|
local function base_template(path)
|
|
local foldername = path:match("([^/]+)[/]?$")
|
|
return [[package ]] .. foldername .. [[\n\n|cursor|]]
|
|
end
|
|
|
|
local template = {
|
|
{ pattern = ".*", content = base_template },
|
|
}
|
|
|
|
return utils.find_entry(template, opts)
|
|
end
|