Skip to content

Fix CustomRemoveAll() to handle spaces in paths, and also file not found. - #906

Merged
mattfarina merged 1 commit into
Masterminds:masterfrom
jpz:fix_windows_delete_issue_with_spaces
Sep 22, 2017
Merged

Fix CustomRemoveAll() to handle spaces in paths, and also file not found.#906
mattfarina merged 1 commit into
Masterminds:masterfrom
jpz:fix_windows_delete_issue_with_spaces

Conversation

@jpz

@jpz jpz commented Sep 10, 2017

Copy link
Copy Markdown
Contributor

Fixes to problem mentioned in #905

This deals with two related implementation details in winbug.go -

  1. the function was not working successfully, because it was not enquoting the path with spaces correctly.

  2. the exit code from Windows RD command (remove directory) should be be handled - "directory not found" should not really be an error. By analogy, rm -rf returns no error code for a non-existent file.

I've tested this several times manually, but nice to get other checks on it.

The Windows fix had a few bugs in it, specifically it would throw
an error if there was a space in the path.  In addition, deleting
a non-existent directory or file, which are not errors under *nix
when using rm, were generating errors on Windows.
@mattfarina
mattfarina merged commit 515f256 into Masterminds:master Sep 22, 2017
@mattfarina

Copy link
Copy Markdown
Member

@jpz thanks for the contribution

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

Successfully merging this pull request may close these issues.

2 participants