rector/ci/clean_trailing_spaces.sh

12 lines
402 B
Bash
Raw Normal View History

2017-12-30 15:41:49 -02:00
#!/usr/bin/env bash
# trailing whitespaces
2019-11-14 15:02:18 +01:00
#see https://stackoverflow.com/questions/2320564/sed-i-command-for-in-place-editing-to-work-with-both-gnu-sed-and-bsd-osx
if sed --version >/dev/null 2>&1; then
#GNU sed (common to linux)
2019-11-16 09:45:14 +01:00
sed -i -E 's#\s+$##g' config/set/*/*.yaml docs/*.md README.md;
2019-11-14 15:02:18 +01:00
else
#BSD sed (common to osX)
sed -i '' -E 's#\\s+$##g' config/set/*/*.yaml docs/*.md README.md
fi