Explorar el Código

restore original file with timestamp if indent did not change anything

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47679 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler hace 13 años
padre
commit
3979c65594
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      tools/grass_indent.sh

+ 2 - 0
tools/grass_indent.sh

@@ -14,4 +14,6 @@ else
  grep -l '\<_$' "$@" | \
      while read file ; do sed -i -e '/[( \t]_$/{;N;s/\n[ \t]*//;}' $file ; done
 
+ # restore original file with timestamp if indent did not change anything
+ cmp "$@"~ "$@" > /dev/null && mv -f "$@"~ "$@"
 fi