Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
prepare-commit.sh: show progress
  • Loading branch information
jef-n committed Mar 25, 2016
1 parent 428ec00 commit b1a4ef2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/astyle.sh
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion scripts/prepare-commit.sh
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b1a4ef2

Please sign in to comment.