From 574d694337213da88ded3380cce91ae9478fb579 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Tue, 3 Oct 2017 22:16:07 +0200 Subject: 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 --- Utilities/Scripts/clang-format.bash | 6 ++++-- 1 file 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 -- cgit v0.12