mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
fix: properly treat files in ZK home
This commit is contained in:
@@ -202,17 +202,21 @@ local function escape(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function recursive_substitution(dir, old, new)
|
local function recursive_substitution(dir, old, new)
|
||||||
os.execute(
|
if vim.fn.has("mac") == 1 or vim.fn.has("unix") == 1 then
|
||||||
"find "
|
os.execute(
|
||||||
.. dir
|
"find "
|
||||||
.. " -type f -name '*"
|
.. dir
|
||||||
.. M.Cfg.extension
|
.. " -type f -name '*"
|
||||||
.. "' -exec sed -i 's|"
|
.. M.Cfg.extension
|
||||||
.. old
|
.. "' -exec sed -i 's|"
|
||||||
.. "|"
|
.. old
|
||||||
.. new
|
.. "|"
|
||||||
.. "|g' {} +"
|
.. new
|
||||||
)
|
.. "|g' {} +"
|
||||||
|
)
|
||||||
|
else
|
||||||
|
print("Cannot open update links on your operating system")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ----------------------------------------------------------------------------
|
-- ----------------------------------------------------------------------------
|
||||||
@@ -1427,7 +1431,7 @@ local function RenameNote()
|
|||||||
newname = newname:gsub("[" .. M.Cfg.extension .. "]+$", "")
|
newname = newname:gsub("[" .. M.Cfg.extension .. "]+$", "")
|
||||||
local newpath = newname:match("(.*/)")
|
local newpath = newname:match("(.*/)")
|
||||||
|
|
||||||
if M.Cfg.subdirs_in_links == true and newpath == nil then
|
if M.Cfg.subdirs_in_links == true and newpath == nil and subdir ~= "" then
|
||||||
newname = subdir .. "/" .. newname
|
newname = subdir .. "/" .. newname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user