Fix: the unexpected clearing of symbolic link directories (#82191)
When I was using the standalone build, the second build would delete the
contents of local packages. As a result, developers had to delete the
cache of local empty directories and re-download the packages. I added a
condition for recursive deletion to avoid this situation.
Fixes #82157