Skip to content

Commit

Permalink
Convenient scripts for working with rbt.
Browse files Browse the repository at this point in the history
Prevents having to memorize flags, and saves some editing in the web form.
  • Loading branch information
Benjy committed Jun 17, 2014
1 parent 615aa21 commit fb983fb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions rbt-create
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# Convenient shortcut script for creating a new Pants rbt review:
#
# ./rbt-create <name> ... <name> <other flags>
#
# will create a review with the specified names as reviewers, with pants-reviews as a group,
# and with the other flags passed through to rbt.

NAME_REGEX="[a-z].+"
REVIEWERS=""

while [[ $1 ]] && [[ $1 =~ ${NAME_REGEX} ]]; do
REVIEWERS="${REVIEWERS},$1"
shift
done

REVIEWERS=${REVIEWERS:1} # Strip leading comma.

if [[ ${REVIEWERS} ]]; then
REVIEWERS_FLAG="--target-people=${REVIEWERS}"
fi

./rbt post -o -g --target-groups=pants-reviews ${REVIEWERS_FLAG} "$@"
9 changes: 9 additions & 0 deletions rbt-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# Convenient shortcut script for updating an existing Pants rbt review:
#
# ./rbt-update <other flags>
#
# will update the existing review, passing the flags through to rbt.

./rbt post -o -u "$@"

0 comments on commit fb983fb

Please sign in to comment.