# owners_cleanup.sh
# Script to remove a given user who's no longer with Zoox from all OWNERS files.
# The script will locate all OWNERS files beneath the current working directory.
#
# Usage
#   sh owners_cleanup.sh USERX

owner_name=$1

# Remove user from all OWNERS files
find . -name OWNERS -exec sed -i '' /$owner_name/d {} \;

# Stage all modified OWNERS files
for o in `git diff --name-only | grep OWNERS$`; do
    git add "$o"
done
