Skip to content
Permalink
Browse files

Merge pull request #2813 from rouault/avoid_astyle_writing_unmodified…

…_files

astyle.sh: make it not touch unmodified files
  • Loading branch information
jef-n committed Feb 19, 2016
2 parents 1e80a98 + ec0be3c commit 07240e31c222a963434ffc8367eaa1a949598b39
Showing with 10 additions and 2 deletions.
  1. +10 −2 scripts/astyle.sh
@@ -56,7 +56,11 @@ set -e

astyleit() {
$ASTYLE --options="$ASTYLEOPTS" "$1"
scripts/unify_includes.pl "$1"
modified=$1.unify_includes_modified
cp "$1" "$modified"
scripts/unify_includes.pl "$modified"
diff "$1" "$modified" >/dev/null || mv "$modified" "$1"
rm -f "$modified"
}

for f in "$@"; do
@@ -103,6 +107,10 @@ for f in "$@"; do
echo "removed BOM from $f"
fi

flip -ub "$f"
modified=$f.flip_modified
cp "$f" "$modified"
flip -ub "$modified"
diff "$f" "$modified" >/dev/null || mv "$modified" "$f"
rm -f "$modified"
eval "$cmd '$f'"
done

0 comments on commit 07240e3

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