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

bugfix: RemoveAll #329

Merged
merged 1 commit into from
Mar 11, 2022
Merged

bugfix: RemoveAll #329

merged 1 commit into from
Mar 11, 2022

Conversation

yearnfar
Copy link
Contributor

when i RemoveAll lib directory, it also Removed libs directory

when i RemoveAll lib directory, it also Removed libs directory
@CLAassistant
Copy link

CLAassistant commented Nov 14, 2021

CLA assistant check
All committers have signed the CLA.

@jxsl13
Copy link

jxsl13 commented Jan 9, 2022

and you need to press on the cla bot signed yet button.

@jxsl13
Copy link

jxsl13 commented Mar 2, 2022

merge pls :D

@mbertschler
Copy link
Collaborator

@yearnfar I don't fully understand what the problem is, you want the directory to be also removed but it currently isn't?

Can you please add a test for this problem?

@jxsl13
Copy link

jxsl13 commented Mar 9, 2022

you add a trailing filepath separator in order to prevent other directories starting with the same prefix from being deleted as well as the one you actually want to delete.

General thought:
A lot of this stuff should not really rely on strings.HasPrefix but rather filepath.Rel(pathA,pathB string) (relPath string, err error)

For MemMapFs this should suffice as iirc it does add a trailing slash at the end of a directory name.

@mbertschler mbertschler merged commit a2bf4c8 into spf13:master Mar 11, 2022
kodiakhq bot referenced this pull request in cloudquery/cloudquery Jun 27, 2022
…1017)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/spf13/afero](https://togithub.com/spf13/afero) | require | minor | `v1.7.0` -> `v1.8.2` |

---

### Release Notes

<details>
<summary>spf13/afero</summary>

### [`v1.8.2`](https://togithub.com/spf13/afero/releases/tag/v1.8.2)

[Compare Source](https://togithub.com/spf13/afero/compare/v1.8.1...v1.8.2)

-   Fix gcsfs RemoveAll by [@&#8203;typerat](https://togithub.com/typerat) in [https://github.com/spf13/afero/pull/340](https://togithub.com/spf13/afero/pull/340)
-   bugfix: RemoveAll by [@&#8203;yearnfar](https://togithub.com/yearnfar) in [https://github.com/spf13/afero/pull/329](https://togithub.com/spf13/afero/pull/329)

### [`v1.8.1`](https://togithub.com/spf13/afero/compare/v1.8.0...v1.8.1)

[Compare Source](https://togithub.com/spf13/afero/compare/v1.8.0...v1.8.1)

### [`v1.8.0`](https://togithub.com/spf13/afero/releases/tag/v1.8.0)

[Compare Source](https://togithub.com/spf13/afero/compare/v1.7.1...v1.8.0)

-   sftpfs: Add support for Readdirnames and Readdir
-   CacheOnReadFs: Call OpenFile instead of Open in CacheOnReadFs.OpenFile

### [`v1.7.1`](https://togithub.com/spf13/afero/compare/v1.7.0...v1.7.1)

[Compare Source](https://togithub.com/spf13/afero/compare/v1.7.0...v1.7.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate).
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.

4 participants