brew
https://github.com/homebrew/brew
Ruby
🍺 The missing package manager for macOS
Pathname#rmdir_if_possible
I don't trust the children.length == 0 check particularly, not to mention it is slow to enumerate the whole directory just to see if it is empty, instead rely on good ol' libc and the filesystem
Edit
git clone [email protected]:homebrew/brew.git
cd brew
open Library/Homebrew/extend/pathname.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Pathname-rmdir_if_possible-for-pr
# Commit to gitgit add Library/Homebrew/extend/pathname.rbgit commit -m "better docs for Pathname#rmdir_if_possible"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Pathname-rmdir_if_possible-for-pr
hub pull-request
# Celebrate!