This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
How to remove recursively a directory? #961
Closed
Description
Hi 😃
what is the recommended way of deleting a not-empty folder from a repo cloned on OS storage?
I am trying to do it with
worktree.Filesystem.Remove(path)
where path is a folder containing some files and I'm getting error remove /tmp/path: directory not empty
I looked a bit into billy's code and there is a RemoveAll
method on OS mimicking the standard lib's os.RemoveAll
but it looks like in worktree.go it's only used in the rmFileAndDirIfEmpty
function...
Any ideas?
Thanks
Note: if I use os.RemoveAll(path)
and try to worktree.Add(path)
I get entry not found