summaryrefslogtreecommitdiffstats
path: root/Utilities/Scripts
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2017-10-03 20:16:07 (GMT)
committerMatthias Maennich <matthias@maennich.net>2017-10-03 20:16:07 (GMT)
commit574d694337213da88ded3380cce91ae9478fb579 (patch)
treec4e87c897343115a321fc99040b1736c26d5c68b /Utilities/Scripts
parent046625d26f8715bd8dc9ddd609a0d8436b810558 (diff)
downloadCMake-574d694337213da88ded3380cce91ae9478fb579.zip
CMake-574d694337213da88ded3380cce91ae9478fb579.tar.gz
CMake-574d694337213da88ded3380cce91ae9478fb579.tar.bz2
clang-format.bash: minor fixes to support MacOS
- sed on Mac does not support embedded sed statements, hence eliminating the non-matches via grep - xargs on Mac does not support -d, but does support -0, hence replacing
Diffstat (limited to 'Utilities/Scripts')
-rwxr-xr-xUtilities/Scripts/clang-format.bash6
1 files changed, 4 insertions, 2 deletions
diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash
index 428a9e4..3b331a1 100755
--- a/Utilities/Scripts/clang-format.bash
+++ b/Utilities/Scripts/clang-format.bash
@@ -111,7 +111,9 @@ $git_ls |
# Select sources with our attribute.
git check-attr --stdin format.clang-format |
- sed -n '/: format\.clang-format: set$/ {s/:[^:]*:[^:]*$//p}' |
+ grep -e ': format\.clang-format: set$' |
+ sed -n 's/:[^:]*:[^:]*$//p' |
# Update sources in-place.
- xargs -d '\n' "$clang_format" -i
+ tr '\n' '\0' |
+ xargs -0 "$clang_format" -i