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

temp_del fails if the temporary folder has a git repository #5

Open
mlopes opened this issue Jun 15, 2017 · 0 comments
Open

temp_del fails if the temporary folder has a git repository #5

mlopes opened this issue Jun 15, 2017 · 0 comments

Comments

@mlopes
Copy link

mlopes commented Jun 15, 2017

I'm using bats-file to test a git plugin I'm writing in bash, so I use temp_make to create a folder run the test and then temp_del to remove the folder. Because of the permissions git sets on the .git folder, when temp_del invokes rm, it asks for user confirmation and blocks the tests.

I've worked around it by pipping yes to the command.
replacing
result="$(rm -r -- "$path" 2>&1)"
with
result="$(yes | rm -r -- "$path" 2>&1)"

An alternative would be to use -fr instead of just -r, but I thought that would be a bit too risky. If you think this might be worth a fix, I can push it upstream and make a PR.

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

No branches or pull requests

1 participant