Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge error in Windows Deletion command, deletes wrong dir. #1399

Closed
WillEhrendreich opened this issue Mar 15, 2024 · 0 comments
Closed

Huge error in Windows Deletion command, deletes wrong dir. #1399

WillEhrendreich opened this issue Mar 15, 2024 · 0 comments

Comments

@WillEhrendreich
Copy link
Contributor

if you're on Windows like this guy you know that when you make a copy of a dir, it will just append " - Copy" on the end, and that's a fine enough solution to that, but the problem is that passing a path to this line:

local result = vim.fn.system({ "cmd.exe", "/c", "rmdir", "/s", "/q", path })

will delete the ORIGINAL DIR!

so trying to delete a dir called "testDir - copy" will delete "testDir".

cmd.exe treats spaces significantly.

anyway, it seems fine when i changed the code to this:

local result = vim.fn.system({ "cmd.exe", "/c", "rmdir", "/s", "/q", '"', path, '"' })
WillEhrendreich added a commit to WillEhrendreich/neo-tree.nvim that referenced this issue Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant