From 3047535cb51bf9ff6980841c0209c0d5fe998f3e Mon Sep 17 00:00:00 2001 From: Toby Batch Date: Wed, 29 Jun 2016 15:31:42 +0100 Subject: [PATCH 1/2] Improved the path of repos --- branches | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/branches b/branches index 5b34ec4..c5d66fe 100755 --- a/branches +++ b/branches @@ -26,13 +26,12 @@ Optional a new named branch can be created and checkout out/pulled. EOF } -while getopts "b:lpfa" options; do +while getopts "b:lpfh" options; do case $options in b) newbranch="$OPTARG";; l) latesttag=1;; p) plainoutput=1;; f) fetchorigin=1;; - a) autotag=1;; h) usage; exit;; esac done @@ -68,6 +67,7 @@ for var in "$ROOTPATH"; do for x in `find $var/* -name .git | grep -v vendor`; do dir=`dirname $x` name=`basename $dir` + clean_dir=${dir#$ROOTPATH/} if [ "$name" == "tabs-api-client" ] || [ "$name" == "contrib" ]; then continue fi @@ -81,19 +81,12 @@ for var in "$ROOTPATH"; do lt=`$GITCMD describe --abbrev=0 --tags 2> /dev/null` diff=`$GITCMD diff refs/heads/${branch}..refs/tags/${lt} 2> /dev/null` if [ ! -z "$diff" ]; then - printf "$COL_MAGENTA%-25s$COL_RESET %-20s $COL_RED%-10s$COL_RESET %s\n" $name $branch $lt $dir - if [ "$name" != "tabs-api-client" ] && [ "$name" != "phpcs" ]; then - if [ ! -z "$autotag" ]; then - drupal-tag -y -b patch $dir - else - EXITSTATE=$(($EXITSTATE + 1)) - fi - fi + printf "$COL_MAGENTA%-25s$COL_RESET %-20s $COL_RED%-10s$COL_RESET %s\n" $name $branch $lt $clean_dir else - printf "$COL_CYAN%-25s$COL_RESET %-20s %-10s %s\n" $name $branch $lt $dir + printf "$COL_CYAN%-25s$COL_RESET %-20s %-10s %s\n" $name $branch $lt $clean_dir fi else - printf "\n%-25s %-20s %s\n" $name $branch $dir + printf "%-25s %-20s %s\n" $name $branch $clean_dir fi if [ ! -z "$newbranch" ]; then # The --git-dir doesn't work in this case From e2bdae55a2d59d60ecc7f822014c03b96de0b514 Mon Sep 17 00:00:00 2001 From: Toby Batch Date: Thu, 21 Jul 2016 11:51:05 +0100 Subject: [PATCH 2/2] New command to test if a term supports colours --- colour-test | 10 ++++++++++ drupal-tag | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 colour-test diff --git a/colour-test b/colour-test new file mode 100755 index 0000000..d3b0a77 --- /dev/null +++ b/colour-test @@ -0,0 +1,10 @@ +#!/bin/bash + +if test -t 1; then + ncolors=$(tput colors) + if test -n "$ncolors" && test $ncolors -ge 8; then + exit 0 + else + exit 1 + fi +fi diff --git a/drupal-tag b/drupal-tag index b49759d..39cc7f3 100755 --- a/drupal-tag +++ b/drupal-tag @@ -72,7 +72,7 @@ if [ -z "$NEWBRANCH" ]; then bumpUp ${MAJOR_VERSION} ${MINOR_VERSION} ${PATCH_VERSION} ${BUMP} NEW_TAG="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}" else - NEW_TAG=$NEWBRANCH + NEW_TAG="$NEWBRANCH" fi echo $NEW_TAG > $NEWCHANGELOG