mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
Create subdirs when creating new note
previously it failed with error message
This commit is contained in:
@@ -448,7 +448,13 @@ local function create_note_from_template(
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- now write the output file, substituting vars line by line
|
-- now write the output file, substituting vars line by line
|
||||||
|
local filedir = title:match("(.*/)") or ""
|
||||||
|
local dir_succeed = check_dir_and_ask(filedir, filedir)
|
||||||
|
if dir_succeed == false then
|
||||||
|
return
|
||||||
|
end
|
||||||
local ofile = io.open(filepath, "a")
|
local ofile = io.open(filepath, "a")
|
||||||
|
|
||||||
for _, line in pairs(lines) do
|
for _, line in pairs(lines) do
|
||||||
ofile:write(
|
ofile:write(
|
||||||
templates.subst_templated_values(
|
templates.subst_templated_values(
|
||||||
|
|||||||
Reference in New Issue
Block a user