浏览代码

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 13 年之前
父节点
当前提交
3979c65594
共有 1 个文件被更改,包括 2 次插入0 次删除
  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