plenary.nvim
plenary.nvim copied to clipboard
Bug with `Path:mkdir()` on Windows
This came up in https://github.com/epwalsh/obsidian.nvim/issues/88 and I think I've tracked it down to a bug with the path module here.
Running:
Path:new("C:/Users/myhome/my/local/obsidian/repo/"):mkdir { parents = true, exist_ok = true }
fails on Windows with
E5108: Error executing lua ...site\pack\packer\start\plenary.nvim/lua/plenary/path.lua:497: We couldn't mkdir: C:\Users\myhome\AppData\Local\nvim\lua\C:/Users/myhome/my/local/obsidian/repo/
stack traceback:
[C]: in function 'error'
...site\pack\packer\start\plenary.nvim/lua/plenary/path.lua:497: in function 'mkdir'
[string ":source (no file)"]:601: in main chunk
Note that C:\Users\myhome\AppData\Local\nvim\lua
is the path to the users configuration files where the call to mkdir()
originates. So it looks like at some point mkdir()
mangles the path by prepending this directory.
Something similar happens in https://github.com/p00f/cphelper.nvim/issues/32, but instead of the nvim directory it appends it to C:\Users\myhome
instead
bump
This issue has been fixed in https://github.com/nvim-lua/plenary.nvim/commit/8aad4396840be7fc42896e3011751b7609ca4119