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

Source | Google | Stack overflow

Edit

git clone [email protected]:homebrew/brew.git

cd brew

open Library/Homebrew/extend/pathname.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Pathname-rmdir_if_possible-for-pr


# Commit to git

git add Library/Homebrew/extend/pathname.rbgit commit -m "better docs for Pathname#rmdir_if_possible"


# Open pull request

gem 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!