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

fix: ignore nonexistant when force rm #6773

Merged
merged 2 commits into from
Dec 2, 2019
Merged

Conversation

olizilla
Copy link
Member

  • Make ipfs files rm --force /nonexistant succeed when the path does not exist.
  • Add shaness test for removing nonexistant paths
  • Refactor duplicated code to find a parent dir into a function

I've been writing scripts against the files api, and having to stat things before removing them is a pain. So this PR aims to make --force do what I'd expect it to.

License: MIT
Signed-off-by: Oli Evans oli@tableflip.io

- Make `ipfs files rm --force /nonexistant` succeed when the path does not exist.
- Add shaness test for removing nonexistant paths
- Refactor duplicated code to find a parent dir into a function

I've been writing scripts against the files api, and having to stat things before removing them is a pain. So this PR aims to make --force do what I'd expect it to.

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit but otherwise LGTM 👍

core/commands/files.go Outdated Show resolved Hide resolved
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
@Stebalien Stebalien merged commit 59834fd into master Dec 2, 2019
@Stebalien Stebalien deleted the rm-force-ignore-nonexistant branch December 2, 2019 18:33
@Stebalien
Copy link
Member

Thanks!

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