diff options
| author | Matthias Maennich <matthias@maennich.net> | 2017-10-03 22:16:07 +0200 |
|---|---|---|
| committer | Matthias Maennich <matthias@maennich.net> | 2017-10-03 22:16:07 +0200 |
| commit | 574d694337213da88ded3380cce91ae9478fb579 (patch) | |
| tree | c4e87c897343115a321fc99040b1736c26d5c68b /Utilities/Scripts | |
| parent | 046625d26f8715bd8dc9ddd609a0d8436b810558 (diff) | |
| download | cmake-574d694337213da88ded3380cce91ae9478fb579.tar.gz | |
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-x | Utilities/Scripts/clang-format.bash | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash index 428a9e48fe..3b331a18f4 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 |
