Skip to content

folder_delete.bat seems superfluous (and wrong'ish). #79

Description

@thebjorn

folder_delete.bat (https://github.com/davidmarble/virtualenvwrapper-win/blob/master/scripts/folder_delete.bat) is only used by rmvirtualenv.bat, and boils down to this line:

for /d /r "%CD%" %%d in (%1) do @if exist "%%d" rd /s/q "%%d"

i.e. recursively iterate from %CD%, matching only directories into %%d, and then delete the directory (including subdirectories, quietly/without prompting). The if exist is there since the for-loop will delete parent directories before recursing into (now non-existent) sub-directories.

rmvirtualenv then tries to delete the directory tree, again, by itself calling rmdir /s /q:

call folder_delete.bat *
cd ..
rmdir "%1" /s /q

(https://github.com/davidmarble/virtualenvwrapper-win/blob/master/scripts/rmvirtualenv.bat#L42)

Changing it to read

cd /d "%WORKON_HOME%"
rmdir "%1" /s /q

seems to work well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions