fix: properly treat files in ZK home

This commit is contained in:
lambtho12
2022-01-18 11:52:35 +01:00
parent 5f19d27a9a
commit 15d4355ac1

View File

@@ -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