2018-01-30 10:33:22 +10:00
|
|
|
#!/bin/bash
|
2012-10-06 13:10:25 +02:00
|
|
|
###########################################################################
|
|
|
|
# astyle-all.sh
|
|
|
|
# ---------------------
|
|
|
|
# Date : August 2008
|
|
|
|
# Copyright : (C) 2008 by Juergen E. Fischer
|
|
|
|
# Email : jef at norbit dot de
|
|
|
|
###########################################################################
|
|
|
|
# #
|
|
|
|
# This program is free software; you can redistribute it and/or modify #
|
|
|
|
# it under the terms of the GNU General Public License as published by #
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or #
|
|
|
|
# (at your option) any later version. #
|
|
|
|
# #
|
|
|
|
###########################################################################
|
|
|
|
|
2008-08-23 20:17:30 +00:00
|
|
|
|
2008-08-30 15:20:16 +00:00
|
|
|
PATH=$PATH:$(dirname $0)
|
2008-08-23 20:17:30 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
export elcr="$(tput el)$(tput cr)"
|
|
|
|
|
2013-02-07 01:09:39 +01:00
|
|
|
find python src tests -type f -print | while read f; do
|
2008-08-23 20:17:30 +00:00
|
|
|
if [ -f "$f.astyle" ]; then
|
|
|
|
# reformat backup
|
|
|
|
cp "$f.astyle" "$f"
|
|
|
|
touch -r "$f.astyle" "$f"
|
|
|
|
else
|
|
|
|
# make backup
|
|
|
|
cp "$f" "$f.astyle"
|
|
|
|
touch -r "$f" "$f.astyle"
|
|
|
|
fi
|
|
|
|
|
2014-05-24 12:07:23 +02:00
|
|
|
echo -ne "Reformatting $f $elcr"
|
2015-04-07 14:27:39 +02:00
|
|
|
astyle.sh "$f" || true
|
2008-08-23 20:17:30 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
echo
|