seachicken / gh-poi

✨ Safely clean up your local branches
https://dev.to/seachicken/safely-clean-up-your-local-branches-9i3
MIT License
642 stars 17 forks source link

fails when directory has unreadable files #57

Closed keturn closed 2 years ago

keturn commented 2 years ago
$ gh poi --dry-run
== DRY RUN ==
✕ Fetching pull requests...
failed to run external command: git, args: [status --short]
warning: could not open directory '_many_modules/': Permission denied

Where _many_modules is a directory I had removed permissions to, i.e. chmod a-rwx _many_modules

git status returns with exit code 0 in this case, but it does print that warning to stderr.

Your Environment

seachicken commented 2 years ago

Thanks for the clear report! I will fix it

seachicken commented 2 years ago

I fixed this issue and release at soon

$ ls -lsa
total 8
0 drwxr-xr-x   5 seito  staff  160  5 23 20:30 .
0 drwx------+  5 seito  staff  160  5 23 19:27 ..
0 drwxr-xr-x  12 seito  staff  384  5 23 20:46 .git
8 -rw-r--r--   1 seito  staff  250  5 23 20:30 README.md
0 d---------   2 seito  staff   64  5 23 19:28 _many_modules

$ gh poi --dry-run
== DRY RUN ==
✔ Fetching pull requests...
- Deleting branches...

Deleted branches
  tuna
    └─ #1  https://github.com/seachicken/can/pull/1 seachicken

Not deleted branches
* main
  salmon
    └─ #2  https://github.com/seachicken/can/pull/2 seachicken
  sardines
    └─ #3  https://github.com/seachicken/can/pull/3 seachicken