mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-18 18:07:06 +00:00
Avoid rewriting the same file multiple times
Also process some more extensions that current source files use.
This commit is contained in:
parent
0bb7395804
commit
8c581eee90
|
@ -1,16 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
OS="$(uname -s)"
|
|
||||||
|
|
||||||
make -C data/tools reindent
|
make -C data/tools reindent
|
||||||
|
|
||||||
if [[ "$OS" == "Linux" ]]; then
|
# use -i for GNU sed and -i '' otherwise
|
||||||
find src/ -not -path "src/modules/*" -name \*.\[ch\]pp -print0 | xargs -0 sed -i -e '$a\'
|
sed --version 2>/dev/null | grep -q 'GNU sed' || i=1
|
||||||
find src/ -not -path "src/modules/*" -name \*.\[ch\]pp -print0 | xargs -0 sed -i 's/[[:blank:]]*$//'
|
|
||||||
find data/ -name \*.lua -print0 | xargs -0 sed -i 's/[[:blank:]]*$//'
|
|
||||||
else
|
|
||||||
find src/ -not -path "src/modules/*" -name \*.\[ch\]pp -print0 | xargs -0 sed -i '' 's/[[:blank:]]*$//'
|
|
||||||
find data/ -name \*.lua -print0 | xargs -0 sed -i '' 's/[[:blank:]]*$//'
|
|
||||||
fi
|
|
||||||
|
|
||||||
find data/ -name \*.lua -print0 | xargs -0 data/tools/check_mixed_indent
|
find src -path src/modules -prune -o \
|
||||||
|
\( -name '*.[cht]pp' -o -name '*.[ch]' -o -name '*.mm' \) -type f \
|
||||||
|
-exec sed -i ${i:+''} -e 's/[[:blank:]]*$//' -e '$a\' {} +
|
||||||
|
|
||||||
|
find data -name '*.lua' -type f \
|
||||||
|
-exec sed -i ${i:+''} -e 's/[[:blank:]]*$//' -e '$a\' {} + \
|
||||||
|
-exec data/tools/check_mixed_indent {} +
|
||||||
|
|
Loading…
Reference in New Issue
Block a user