QGIS/scripts/astyle-all.sh

40 lines
1.3 KiB
Bash
Raw Normal View History

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. #
# #
###########################################################################
PATH=$PATH:$(dirname $0)
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
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
done
echo