Last active
October 11, 2015 20:08
-
-
Save rhowardiv/3912807 to your computer and use it in GitHub Desktop.
Get a random PR checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get a random PR checker | |
# Loops through everyone before showing the same name twice | |
ME=rhoward | |
# Takes optional argument for commit group if you want not from "ALL" | |
COMMIT_GROUP="ALL" | |
if [ $# -gt 0 ]; then | |
COMMIT_GROUP="$1" | |
fi | |
QFILE="/tmp/rpr$COMMIT_GROUP" | |
Q=$(cat "$QFILE") | |
if [ $? -ne 0 ]; then | |
echo -n "Creating random PR checker queue file..." 1>&2 | |
touch "$QFILE" | |
echo "Done." 1>&2 | |
fi | |
if [ -z "$Q" ]; then | |
Q=$(\ | |
cat /home/$ME/ayi/classes/CodeManagement.php | \ | |
sed -n "/'$COMMIT_GROUP' =>/,/),/p" | sed -e 1d -e \$d \ | |
| grep -v "$ME\|msherov\|dkandpal\|dstraus" \ | |
| cut -d "'" -f 2 \ | |
| sort -R | |
) | |
fi | |
echo "$Q" | sed 1q | |
echo "$Q" | sed 1d > "$QFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment