Ver código fonte

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
Matthias Maennich 8 anos atrás
pai
commit
574d694337
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      Utilities/Scripts/clang-format.bash

+ 4 - 2
Utilities/Scripts/clang-format.bash

@@ -111,7 +111,9 @@ $git_ls |
 
 
   # Select sources with our attribute.
   # Select sources with our attribute.
   git check-attr --stdin format.clang-format |
   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.
   # Update sources in-place.
-  xargs -d '\n' "$clang_format" -i
+  tr '\n' '\0'                               |
+  xargs -0 "$clang_format" -i