Skip to content
Permalink
Browse files

prepare-commit.sh: show progress

  • Loading branch information
jef-n committed Mar 25, 2016
1 parent 428ec00 commit b1a4ef27da4397c71bfba4938b53ba0efb26b923
Showing with 7 additions and 3 deletions.
  1. +2 −2 scripts/astyle.sh
  2. +5 −1 scripts/prepare-commit.sh
@@ -28,9 +28,9 @@ if [ -z "$ASTYLE" ]; then
fi

if type -p tput >/dev/null; then
elcr="$(tput el)$(tput cr)"
elcr="$ASTYLEPROGRESS$(tput el)$(tput cr)"
else
elcr=" \r"
elcr="$ASTYLEPROGRESS \r"
fi

if ! type -p flip >/dev/null; then
@@ -64,7 +64,11 @@ ASTYLEDIFF=astyle.$REV.diff
>$ASTYLEDIFF

# reformat
i=0
N=$(echo $MODIFIED | wc -w)
for f in $MODIFIED; do
(( i++ )) || true

case "$f" in
src/core/gps/qextserialport/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
@@ -82,7 +86,7 @@ for f in $MODIFIED; do
m=$f.$REV.prepare

cp $f $m
astyle.sh $f
ASTYLEPROGRESS=" [$i/$N]" astyle.sh $f
if diff -u $m $f >>$ASTYLEDIFF; then
# no difference found
rm $m

0 comments on commit b1a4ef2

Please sign in to comment.
You can’t perform that action at this time.