-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add force
flag to delete-tree
#120
Conversation
The posix stuff only works on linux/mac, perhaps there is another way which is more OS-agnostic. |
The windows part, sure, I have to fix it, any tips on how to test it without a windows computer?
If the directory already have the right permissions ( |
you're right |
Maybe File.setWriteable etc will suffice on Windows? |
Looks like that :-) : https://github.com/jlesquembre/fs/actions/runs/7268334832 |
|
I don't think so,
The only case where we touch the permissions, and a delete would have happened successfully is on windows if a file is already writable. We call
I think mean here, right? https://github.com/jlesquembre/fs/blob/0468ac76bef9f054400de9da5030203c2351c15a/src/babashka/fs.cljc#L583-L584 The issue is that I don't want to touch the permissions if not necessary (with the exception of already writable files on windows, since it makes sense to me to just enforce that is writable and avoid calling But the rules are different on posix vs windows:
I wrote some tests on my fork to test those assumptions, I can add it to the PR if it makes sense: https://github.com/jlesquembre/fs/actions/runs/7281870406 |
OK, let's add those tests and I'll merge |
Btw, this issue might also be relevant to the above: |
I added the tests, and a comment point out that the implementation is based on those assumptions. |
Thanks! |
Closes #119
Please answer the following questions and leave the below in as part of your PR.
This PR corresponds to an issue with a clear problem statement.
This PR contains a test to prevent against future regressions
I have updated the CHANGELOG.md file with a description of the addressed issue.